extern void f( unsigned int );
extern void f( int );
extern void f( char );

int main() {
    unsigned char uc;
    f( uc );
    return 0;
Which variant of the overloaded function f will be called?
(provided that unsigned char occupies 1 byte and int occupies 4 bytes)
The void f( int ) function will be called because its formal parameter provides the best match to the type of the actual parameter, since unsigned char is converted to int by type extension, and unsigned int and char by standard type conversion.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Зарегистрируйся сейчас
или Подпишись на будущие тесты