Why doesnt that code work?

Submitted by: Administrator
Why doesn't the code
short int s;
scanf("%d", &s);

work?

When converting %d, scanf expects a pointer to an int. To convert to a short int, use %hd .
Submitted by: Administrator

Read Online C Programming Job Interview Questions And Answers