小想法
AcceptedMaybe
这个作者很懒,什么都没留下…
展开
-
强制类型转换
强制类型转换 (float)x / y 和 float ( x / y ) 区别 : 前者先将 x 转化为 float 类型 ,再进行计算 ,后者则是先计算 除法,此时可能已经舍去了小数 int b = 5,c=2; cout << (float) b / c << endl; // 输出 2.5 cout << float (b / c) << endl; // 输出 2 ...原创 2020-10-19 20:02:27 · 201 阅读 · 0 评论 -
对象复制构造函数加深
template<class T> void chainList<T>::output(ostream& out) const {// Put the list into the stream out. for (chain<T>* currentNode = firstNode; currentNode != NULL; currentNod...原创 2020-03-05 00:47:17 · 84 阅读 · 0 评论