原地址 http://www.cplusplus.com/doc/tutorial/pointers/ Pointers In earlier chapters, variables have been explained as locations in the computer's memory which can be accessed by their identifier (their name). This way, the program does not need to care…
Background C++ is one of the main development languages used by many of Google's open-source projects. As every C++ programmer knows, the language has many powerful features, but this power brings with it complexity, which in turn can make code more…
The first motivation for const seems to have been to eliminate the use of preprocessor #define for value substitution. It has since been put to use for pointers, function arguments, return types, class objects and member functions. (Page 334) 1 Value…
Just like normal variables, pointers can be declared constant. There are two different ways that pointers and const can be intermixed, and they are very easy to mix up. To declare a const pointer, use the const keyword between the asterisk and the po…
Google C++ Style Guide Table of Contents Header Files Self-contained Headers The #define Guard Forward Declarations Inline Functions Names and Order of Includes Scoping Namespaces Unnamed Namespaces and Static Variables Nonmember, Static Member, an…