摘要: 好处: 对象共享变量,属于类的。 关键点: 成员声明和定义的位置。 静态函数没有 this 指针。 阅读全文
posted @ 2018-08-21 15:56 cp1usplus 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Memory Layout for Multiple and Virtual Inheritance Warning. This article is rather technical and assumes a good knowledge of C++ and some assembly lan 阅读全文
posted @ 2018-07-10 14:05 cp1usplus 阅读(2891) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-07-09 10:57 cp1usplus 阅读(224) 评论(0) 推荐(0) 编辑
摘要: Two function: In namespace and block scope Using-declaration introduces a member of another namespace into current namespace or block scope In class d 阅读全文
posted @ 2018-07-03 13:59 cp1usplus 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 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() ... 阅读全文
posted @ 2018-06-28 11:26 cp1usplus 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Sizeof on dynamically allocated memory delete [] does know the size that was allocated. However, that knowledge resides in the runtime or in the opera 阅读全文
posted @ 2018-05-31 11:20 cp1usplus 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Copy constructors, assignment operators, and exception safe assignment link: http://www.cplusplus.com/articles/y8hv0pDG/ Error: 这是我犯的第一错误: 这是一个构造函数, 而 阅读全文
posted @ 2018-05-24 19:19 cp1usplus 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Memory Layout of C Programs A typical memory representation of C program consists of following sections. 1. Text segment2. Initialized data segment3. 阅读全文
posted @ 2018-04-27 11:01 cp1usplus 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-04-25 15:31 cp1usplus 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-04-19 09:05 cp1usplus 阅读(311) 评论(0) 推荐(0) 编辑