How to read string with spaces, with scanf() in C?

Without using gets() and fgets(),

Use,

char s[100];
scanf(“%[^/n]”,s);
prinf("%s",s);

--

--