Code:
int y;
short s;
scanf("%d %d", &y, &s);
printf("%d,%d\n", y, s);
Obviously the printf() doesn't care %hd or %d,but why y presents "0" instead of s in the case of s received the wrong type and s presents rightly
int y;
short s;
scanf("%d %d", &y, &s);
printf("%d,%d\n", y, s);
int y;
short s;
scanf("%d %d", &y, &s);
printf("%d,%d\n", y, s);
Comment