Basic and Advance C Question:

Why doesnt that code work?

Tweet Share WhatsApp

Answer:

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 .

Download C Programming PDF Read All 221 C Programming Questions
Previous QuestionNext Question
How can I read data from data files with particular formats?Why doesnt this code work?