June 27, 2000

DevX - Software Development Resource

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

DevX - Software Development Resource

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

DevX - Software Development Resource

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

DevX - Software Development Resource

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

DevX - Software Development Resource

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

DevX - Software Development Resource

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