You are viewing a single comment's thread. Return to all comments →
scanf("%[^\n]%*c", &s);
[^\n]-prints whole string for example in "hello guys" only hello will be printed but after [^\n] whole string will be printed considering space.
"Hello World!" in C
You are viewing a single comment's thread. Return to all comments →
scanf("%[^\n]%*c", &s);
[^\n]-prints whole string for example in "hello guys" only hello will be printed but after [^\n] whole string will be printed considering space.