There is one final way to pass a string into a function, which is to pass a string literal as a function parameter, as follows:
Func5( "Passing a string literal" );
In this function declaration, the "Passing a string literal" string literal is the string that is passed into Func5() when it is called. Func5() can be declared in any of the following ways:
void Func5( char[] aStr );
void Func5( char* aStr );
void Func5( const char[] aStr );
void Func5( const * aStr );
The first two declarations take a non-constant array name or pointer parameter, while the last two declarations take a constant array name or pointer parameter. Because the parameter string being passed into Func5() is a string literal, it remains a constant and its elements cannot be changed within the function body.
This is another kind of initialization and it is rather subtle. However, we have already seen this done many times. We first...