0
scanf("%2d %d %*f %5s", &x, &y, text); /* input: 1234 5.7 elephant */ printf("%d %d %s", x, y, text); /* output: 12 34
Please explain it
4 Réponses
+ 2
Asad Zaman,
The <text> variable will store only 5 characters of the given input string. So it contains 'eleph', and the output will be
12 34 eleph
+ 2
Martin,
That one was for the OP ☝
I did mention him ...
0
I'm asking about our input is 1234,5.7 and elephand
But where has gone 5.7 and what is %*f
Sorry for my english
0
Thank you Martin Taylor