Search code examples
cdebugginguser-input

How to scan a string including the Space and Tab?


I'm often using C code to take some input and manipulate it; for example, I want to scan a full phrase like "hello world" but as it contains a space, I find myself forced to use "gets" to include the spaces or even tabs sometimes.


Solution

  • you cant use scanf() or fgets, just remember use the stdin as input stream