随笔分类 -  C++

摘要:命名规则 变量名只能是字母和数字或者下划线组成。 第一个字母必须是字母或者下划线开头,数字不能开头。 不能使用C++关键字来命名变量,以免冲突。 变量名区分大小写。 因此,这些变量名都是合法的:Bool fabs _member cin(cin当然是合法的)。 这些是不合法的extern(这是关键字 阅读全文
posted @ 2023-01-23 18:37 dunhedunhe 阅读(47) 评论(0) 推荐(0)
摘要:构造 string::string - C++ Reference (cplusplus.com) 常用函数 分离字符串abc.in - 顿河顿河 - 博客园 (cnblogs.com) 特殊的成员 https://cplusplus.com/reference/string/string/npos 阅读全文
posted @ 2022-08-04 23:54 dunhedunhe 阅读(37) 评论(0) 推荐(0)
摘要:cout的计算顺序从右向左,输出顺序从左向右 假设a = 1; b = 2; c = 3;cout<<a<<b<<c<<endl;缓冲区:|3|2|1|<- (把“<-”看作是指针)输出: |3|2|<- (输出 1) |3|<- (输出 2) |<- (输出 3)结果就是123. C++输出流co 阅读全文
posted @ 2022-08-04 21:48 dunhedunhe 阅读(586) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-04-16 15:26 dunhedunhe 阅读(75) 评论(0) 推荐(0)
摘要:注意对 bool 变量按位取反永远是 true; 0000 0001 1111 1110 所以用非运算符!代替 bool showGrid; showGrid=!showGrad; //这个才变 showGrid=~showGrad; //不变 阅读全文
posted @ 2022-04-10 12:26 dunhedunhe 阅读(2426) 评论(0) 推荐(0)