摘要:
类型转换演示视频 https://www.bilibili.com/video/av82226338/ 对应的代码: 1 #include <iostream> 2 3 int main() { 4 int i = 42; 5 std::cout << i << std::endl; // prin 阅读全文
摘要:
下面是简单演示不同类型在内存中的表示(测试环境为vs2019,x64,不同编译器和编译配置可能有所差别): 1 #include <iostream> 2 3 int main() { 4 bool b=true; 5 int i=1; 6 float f=1; 7 double d=1; 8 re 阅读全文
摘要:
本节源码位于avg_price.cpp中 1 #include <iostream> 2 #include "Sales_item.h" 3 4 int main12() 5 { 6 Sales_item total; // variable to hold data for the next tr 阅读全文
摘要:
书中演示源码位于文件add_item2.cpp 阅读全文
摘要:
现在不需要知道Sales_item类的实现细节,只需要知道:1、这个类定义了一种新的类型;2、我们能对这个类型执行什么操作。 读写Sales_item 源码在文件item_io.cpp,下面是完整源码: 1 #include "Sales_item.h" 2 3 int main() 4 { 5 S 阅读全文