Alternatively, a switch statement can be used for multiple choice operations. This sample converts a number input to text.

switch( number_value )
{
case 37:
text = "thirty-seven";
break; // this line prevents the program from writing over this value with the
// following code
case 23:
text = "twenty-three";
break;
default: // this is used if none of the previous cases contain the value
text = "unknown number";
}

Generally, the interfaces are defined before the implementation in header files (often *.h) or above the implementation. The implementation files are often named *.c. Useful collections of classes can be compiled into libraries, often *.dll, *.a, or *.so, which can be compiled into executables (statically linked) or used on the fly (dynamically linked).

Often using the one you don't want will compile, and will produce results you did not expect.

A good practice is to write; if(CONSTANT == variable) rather than if(variable == CONSTANT) since the compiler will catch; if(CONSTANT = variable) but not if(variable = CONSTANT).

Use a compiler that generates lots of helpful warnings, even if the code is valid. You could also / instead use a program such as 'lint'. This will help you avoid simple bugs such as the above-mentioned bug "if ( x = 1 )" instead of "if ( x == 1 )".