@WilliamPursell I have definitely turned into a crank on this subject, but I firmly believe that the only use for
scanf
is for beginning programmers to get
int
values into their programs, so that they can do things like print NxN boxes made of
*
characters, during the first 2-3 weeks that they're learning C. After that they need to aggressively wean themselves off of all uses of
scanf
, never to use it again.
scanf
is square training wheels. But once you're using it for dirt-simple things, it's almost impossible not to get trapped into trying to use it for more complicated things. —
Steve Summit 39 secs ago