June 27, 2000

What’s in a Block?

A compound statement is a sequence of one or more statements enclosed between { and }. For example: for (int n=0; n

Re-entrant Functions

A function that can be safely called while it’s already executing is said to be re-entrant. The C++ standard doesn’t state whether the Standard Library’s functions are re-entrant; this is

A Shorthand for Internationalization

The software industry uses the term “I18N” as an abbreviation for the terminternationalization. The idea is that I18N begins with an i, ends with an n, and has 18 characters

Shorthand for Assignment Expressions

For recursive assignment expressions such as the following: x = x+5; x= x/5;x = x * 5; C++ defines shorter versions that eliminate the need to repeat the variable’s name

Parenthesize Complex Expressions for Clarity

Although C++ clearly defines operators’ precedence, the compiler is allowed to compute subexpressions with identical precedence in a platform-defined order. Besides, many programmers don’t remember which operators have higher precedence

Referring to a Class Member

You can refer to a name of a class member only in one of the following contexts: In the scope of its class or a class derived from its class