First, consider a real code editor instead of something like MS Word that capitalizes unwantedly and automatically. C and C++ are case sensitive. And I'm sure there must be plenty of good, and free, code editors available.
Second, it's a bad idea to use eof() to control a loop. Check for success rather than one possible failure.
Third, using strcat to do a strcpy may not be the safest choice.
Now, do you have an actual copy-and-paste of your actual code, and perhaps a sample input, so that it would be easier for me (and others) to try to help you?
Reputation Points: 2780
Solved Threads: 312
long time no c
Offline 4,790 posts
since Apr 2004