return_type class_name::function_name(argument_1_type arg_1_name,
argument_2_type arg_2_name,
default_argument_type default_arg_name){// work with arg_1_name, arg_2_name, and default_arg_name// depending on the argument types the variables are passed by // value, reference, or are constant// don't forget to return something of the return typereturn36;}

IMPORTANT POINT A beginner in C/C++ might get confused about the distinction between how pointers are declared in a function prototype vs. how the function is defined. For example, if my_function does not return anything, but accepts one floating point input, its function prototype looks as follows:

void my_function(float*some_variable);

However, if the variable my_var is defined to be a pointer to a float, for example:

float*my_var;

Then the manner in which my_function is invoked is as follows:

my_function(my_var);

Beginners sometimes get confused about the fact that a "*" is used to tell the compiler in a prototype statment that a variable is a pointer, but a "*" is not syntactically used during invocation of a function that accepts a pointer as input.

If and only if A is equal to B assign C to D, otherwise, assign E to F.

if( A == B ){
D = C;// more code can be added here. It is used if and only if A is equal to B}else{
F = E;// more code can be added here. It is used if and only if A is not equal to B}

or

if( A == B )
D = C;//more lines of code are not permitted after this statementelse
F = E;

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

switch( number_value ){case37:
text ="thirty-seven";break;// this line prevents the program from writing over this value with the// following codecase23:
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 in header files, often *.h. The implementation files are often named *.cpp. 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).

Andrew Koenig & Barbara E. Moo, Accelerated C++ (ISBN 020170353X). This is another introduction to C++, but stresses the use of the STL. It is a quite compact introduction, with a steeper learning curve better suited for those who already know another programming language.

Herbert Schildt, C++: The Complete Reference (ISBN 0072226803). It contains dictionary-like listings of code syntax and usage. The structure does not make it useful to learn the language from scratch. However, it could be very useful when switching from a similar language.

Bjarne Stroustrup, The C++ Programming Language (ISBN 0201889544). Written by the creator of C++, it covers everything from the core language to the standard library. The book itself has over 1300 pages.