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)
Explanation
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
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести