i don't have much code in this and am getting an error...
The algorithm design calls for opening:
the actual source file "fileMerge_axxxx.cpp" to read from
the header file to read from
and
a copy of the source file to write to
i entered debug statements that you can see in the code to make sure they are opening successfully and I continue to get "error opening inFileHeader"
while the others open successfully.
I'm about 2 years experienced with c++ and I don't understand why I have this problem.
Is there anything that sticks out to anyone?
I cannot see the problem.
i thought that might be the case, but it is in fact not.
to test for that i entered
"inFileSource.close();"
in the code right after
inFileSource.open("fileMerge_axxxx.cpp");
so that it wouldn't be "in use" and I'm still getting the same error.
i know this is correct because when i test it using inFileHeader it prints everything to the variable testString and to the screen.
here is the design algorithm I'm supposed to be following, am I not going about this the right way?
1 2 3 4 5 6 7 8 9 10 11 12 13 14
set up two input file streams and one output file stream
for one input stream, open the source (.cpp) file of this program
for the other input stream, open the header (.h) file of this program
for the output stream, open a “copy” source (.cpp) file
repeat
read a line from the source input file
if the line matches the “include header file” statement
repeat
read a line from the header input file
write the line that was read to the output file
until at the end of the header input file
otherwise
write the line that was read to the output file
until at the end of the source input file
it looks as if the program is supposed to be reading from the source file itself that is executing, is that possible? am i misinterpreting?