Hello. I am trying to accept a paragraph from the user in C using codeblocks. But, with the scanf statement, the program stops accepting once i hit space. Is there some way to get around this problem?
TheOnlyRoss
0
Newbie Poster
Recommended Answers
Jump to Postuse fgets() instead of scanf() so that all the words get put into the string.
int main() { char line[100]; fgets(line, sizeof(line), stdin); }
All 2 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
zeroliken
79
Nearly a Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.