|
|
Declarations as statements - declarations in conditions |
Introduce and initialize a variable at the place where it is first used It is possible to delare variables in a condition of an if statement |
|
|
|
Some words about compilation of these programs: I use g++ to compile C++ programs.
In most examples in this material, C++ files have file extension cc. Alternatively, cpp is also a popular file extension for C++ files.
If gcc is activated on a cc or cpp file, it will activate the C++ compiler. To prevent this, use the compiler option -x c.
Thus, to compile this file as a C89 c program, write gcc -x c -std=c89 -pedantic less-localized.cc |