摘要: 转自某楼层的回复http://bbs.csdn.net/topics/280085643 首先,讨论这个问题应该仅从语法上讨论,如果讨论不同人之间编程风格上的差异,那这个问题是没有答案的。毕竟不同的人偏好不同。从语法上,在C++中(只讨论C++中)。class和struct做类型定义时只有两点区别: 阅读全文
posted @ 2017-09-05 18:43 Commence 阅读(627) 评论(0) 推荐(0) 编辑
摘要: 查找字符串a是否包含子串b,不是用strA.find(strB) > 0而是strA.find(strB) != string:nposstring::size_type pos = strA.find(strB);if(pos != string::npos){} int idx = str.fi 阅读全文
posted @ 2017-09-05 14:34 Commence 阅读(7549) 评论(0) 推荐(0) 编辑
摘要: 转载自http://www.cnblogs.com/tangxin-blog/p/5560699.html 参考文献:http://blog.csdn.net/zhaqiwen/article/details/7904515 近日在看项目中的框架代码时,发现了了一个奇特的语法:长度为0的数组例如 u 阅读全文
posted @ 2017-09-05 12:33 Commence 阅读(1622) 评论(0) 推荐(0) 编辑