Closed tebello-thejane closed 8 years ago
The example code has strange behaviour. In particular, it seems to prompt 6 times while only reading the first 5 numbers. Removing the aberrant space in the scanf format specifier seems to fix it.
Thanks!
For reference, and interest's sake, the following explains why trailing spaces in scanf are never a good idea:
scanf
http://stackoverflow.com/a/22515719/3085914
The example code has strange behaviour. In particular, it seems to prompt 6 times while only reading the first 5 numbers. Removing the aberrant space in the scanf format specifier seems to fix it.