C++的隐式类型转换

上传:huizhi87546 浏览: 22 推荐: 0 文件:PDF 大小:43.6KB 上传时间:2020-12-23 02:59:41 版权申诉
C++是一种复杂的语言,其中有许多“好玩”的特性,学习C++的过程像在海边捡一颗颗石头,只要坚持不懈,也许一颗颗小石头也能建起你自己小小的城堡。 废话完后,讲讲自己捡到的石头:隐式类型转换 学习出处:《Effective C++》 lostmouse大人翻译 class TestInt { public: int GetData()const{ return i;}; TestInt(int ii):i(ii){}; //构造函数 private: int i; }; void fun(TestInt t) { cout<<t.GetData()&
上传资源
用户评论