Hello, I've seen plenty of posts on how to write to a file, or how to read from a file, but not any on how to read from one file and then write to another. Here I'm trying to read from one file, make all the letters caps, and then write to another. Any help would be appreciated. Both of the files have been created. The change from lower to uppercase does work. Later on I'll have the program do additional changes. 4in.txt is the declaration of independence. p4out1.txt is blank. They are in their proper directories as required for visual studio 2012. The program seems to do everything I want it to do so far except for writing to p4out1.txt. I run the program and the only output in p4out1.txt is 'ÿ'.
Line 48 is inside of a while loop. That means that it will be created opened and then, destructed every character. Every time you open it, you will also be overwriting any previously saved versions of the file (including operations done last iteration).
To solve your problem, insert line 48-49 to line 44.
Do you mean one byte shorter than the original? I can see the original testing for EOF, not seeing it, reading an EOF, writing it to the output stream, then testing for EOF and giving false.
Meanwhile, I see Cubbi's solution attempting to get a EOF and returning false (does it return a void pointer? I don't see any documentation that it returns false). I don't see it printing EOF to the output stream since I suppose it wouldn't get(\0), so I would think it would be one byte shorter.