| <<< Resolving overloaded function calls | Index | Access control >>> |
void print( char ch );
void print( int num );
void print( char* str );
void foo()
{
print( 'g' ); // exact match with char
print( 3 ); // exact match with int
short xx = 2;
print( x ); // promotes x to int
print( 3.4 ); // error: ambiguous call to overloaded function
print( "OK" ); // exact match with char*
print( NULL ); // exact match with int (!!!)
}
| <<< Resolving overloaded function calls | Index | Access control >>> |