有些规则其实照做就是,可是有时就钻了牛角想知道WHY,搞不清楚且似乎不是那么着急的疑问就先记在这里。
1、main函数的返回值
"The main function is required to have a return type of int, which is the type that represents integers. The int type is a built-in type, which means that the type is defined by the language. "-C++ Primer.v4
2、注释的位置
【规则 2 -7 -6 】注释的位置应与被描述的代码相邻 ,可以放在代码的上方或右方,不可放在下方。
-高质量C++/C编程指南(作者:林锐 博士)
3、for循环里的 i++ 和 ++i
听说后者更好,but why ?
1、main函数的返回值
"The main function is required to have a return type of int, which is the type that represents integers. The int type is a built-in type, which means that the type is defined by the language. "-C++ Primer.v4
2、注释的位置
【规则 2 -7 -6 】注释的位置应与被描述的代码相邻 ,可以放在代码的上方或右方,不可放在下方。
-高质量C++/C编程指南(作者:林锐 博士)
3、for循环里的 i++ 和 ++i
听说后者更好,but why ?
本文探讨了C++编程中的一些细节问题,包括main函数的返回值类型为何为int,注释的最佳放置位置以及for循环中i++与++i的区别。
106

被折叠的 条评论
为什么被折叠?



