摘要:
好处: 对象共享变量,属于类的。 关键点: 成员声明和定义的位置。 静态函数没有 this 指针。 阅读全文
摘要:
Memory Layout for Multiple and Virtual Inheritance Warning. This article is rather technical and assumes a good knowledge of C++ and some assembly lan 阅读全文
摘要:
Note that some older compilers (e.g. Visual Studio 6) do not support covariant return types. One interesting note about covariant return types: C++ ca 阅读全文
摘要:
Two function: In namespace and block scope Using-declaration introduces a member of another namespace into current namespace or block scope In class d 阅读全文
摘要:
1 #include // for assert() 2 #include // for std::initializer_list 3 #include 4 5 class IntArray 6 { 7 private: 8 int m_length; 9 int *m_data; 10 11 public: 12 IntArray() ... 阅读全文
摘要:
Sizeof on dynamically allocated memory delete [] does know the size that was allocated. However, that knowledge resides in the runtime or in the opera 阅读全文
摘要:
Copy constructors, assignment operators, and exception safe assignment link: http://www.cplusplus.com/articles/y8hv0pDG/ Error: 这是我犯的第一错误: 这是一个构造函数, 而 阅读全文
摘要:
Memory Layout of C Programs A typical memory representation of C program consists of following sections. 1. Text segment2. Initialized data segment3. 阅读全文
摘要:
Contrary to the other answers, there is no undefined behavior here, and there is no overflow. Unsigned integers use modulo 2n arithmetic. Section 4.7 阅读全文
摘要:
As a newbie programmer, i sometimes encouter the failure that the header files include each other. This article will illustrate why and how to solve t 阅读全文