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.
Seems like cookies are disabled on this browser, please enable them to open this website
"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.