Just one question, how to add space end of string?
Thundermax 0 Light Poster
Recommended Answers
Jump to PostCan't help you until you show us the code that stores the words. It could be as simple as
strcat(word," ");
, but might not too. It all depends on how you wrote the code.
Jump to PostYou need to remove the newline char that fgets() always adds to the end of the string it receives.
Nice actually looks like this, when it's the last word in the string: "nice\n\0". And what you are searching for is "nice\0".
So a bit of code for inside the for …
All 5 Replies
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Thundermax 0 Light Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Thundermax 0 Light Poster
Adak 419 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.