scanf() can do wonderful things. The problem is you have to master its
format string.
A 15 minute job for any C programmer. And a piece of cake for anyone
who has already mastered the Fortran FORMAT statements.
Furthermore, you have to know that the other programmers on
your team have also mastered its intricacies.
Why? If they don't understand my code, they know where to find me.
The scan set required by such a scanf() call is really trivial.
A little less trivial is how to decide whether to call getchar() after
or not.
char buff[1024 + 1];
int rc = scanf("%1024[^\n]%*[^\n]", buff);
if (!feof(stdin) && !ferror(stdin)) getchar();
If rc == 0 stdin was already at eof and the contents of buff should not
be examined at all.