O'Reilly logo

SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Naming

Despite the move to classes and object-orientation, not much has changed about how things are named. As before, types are prefixed with “a” or “an,” while formal arguments are prefixed with “the.” You can see how this makes it easy to understand the scope, source, and life span of variables and their content, and to distinguish a class declaration from an instance of the class.

In addition, use of the prefix “my” is continued, but in a slightly different context.

In the procedural Accumulator() function, myAccumulator was a static local variable whose life span was the same as the program. It provided Accumulator() with internal state and made it more like an object. In the case of classes, the prefix “my” is used for member variables, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required