SyntaxFix
Write A Post
Hire A Developer
Questions
Try this:
scanf("%[^\n]s",name);
\n just sets the delimiter for the scanned string.
\n