随笔分类 - Thinking in C++
摘要:1 There are certain rules when using references: (Page 451)A reference must be initialized when it is created. (Pointers can be initialized at any ...
阅读全文
摘要:static: (Page 406)In both C and C++ the keyword static has two basic meanings, which unfortunately often step on each other's toes.1 Allocated ...
阅读全文
摘要:Problems: (Page 372)There are two problems with the use of proprocessor macros in C++. The first is also with C: a macro looks like a function ca...
阅读全文
摘要:The first motivation for constseems to have been to eliminate the use of preprocessor #definefor value substitution. It has since been put to use for ...
阅读全文
摘要:Why need initialization and cleanup?A large segment of C bugs occur when the programmer forgets to initialize or clean up a variable.The class designe...
阅读全文
摘要:The variables are guaranteed to be laid out contiguously, as in C. However, the access blocks may not appear in the object in the order that you decla...
阅读全文
摘要:What is an object? (Page 238)In C++, an object is just a variable, and the purest definition is "a region of storage" (this is a more specific way ...
阅读全文
摘要:1 unnamed arguments in the argument list of the function definition (Page 114)In c++, an argument may be unnamed in the argument list of the functi...
阅读全文
摘要:1 Declarations VS definitions (Page 81) declarations: This function or variable exists somewhere, and here is what it should look like. definitions:...
阅读全文
浙公网安备 33010602011771号