摘要:
``` c++ 英文解释: if you declare a method to be static in your .cc file. The reason is that static means something different inside .cc files than in class declarations It is really stupid, but the keywor 阅读全文
posted @ 2020-02-23 11:15
friedCoder
阅读(429)
评论(0)
推荐(0)
摘要:
这种问题一般是因为引用了匿名变量。涉及左值和右值的区别。一般函数的参数如果是一个表达式,那将会产生一个第3方的匿名变量传入这个函数中,此时如果引用,没用什么实际意义。 c++中临时变量不能作为非const的引用参数 阅读全文
posted @ 2020-02-23 10:57
friedCoder
阅读(3144)
评论(0)
推荐(0)
摘要:
in C++, cannot assign a pointer to an array. c++中char 与char[]不是一种类型,但是在C里面可以,所以尽量使用C++中的类,如string, vector等等。若非一定要解决这个问题,可以使用`char ptr = new char[2];` 阅读全文
posted @ 2020-02-23 10:54
friedCoder
阅读(7008)
评论(0)
推荐(0)

浙公网安备 33010602011771号