Search code examples
cstdio

Suppressing blankspace in input through scanf


To suppress newline we use %[^\n]. Can you suggest what should be the format to skip blank in the input, i.e. if we have to input "hallo stackflow". I know fgets and gets but i don't want to use them, they are creating problem.


Solution

  • Put a blank in the scanf format; that suppresses whitespace.