1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <cstdio> void foo(unsigned short x) { puts("x is a unsigned short"); } void foo(int x) { puts("x is an int"); } int main() { unsigned short x = 5; foo(x); foo(+x); }
1 2
x is a unsigned short x is an int