I'm trying to make a program to "copy and paste" the rest of the lines starting with " Frequencies --" from a data file to a new file. I have the .exe in the folder with the .OUT files (my inputs.) The .DAT files I create remain at 0KB and the program runs forever.
hey, ok,
you have while (!infile.eof()); after a curly bracket. should'nt be where the do is instead of it. and also i think the strcat(filename, ".OUT") and strcat(filename, ".DAT") make it read the filename as .OUT'filename' , anyway look it up. consider making a different file, and cut this code down to work with the basics. like using .txt's. in other words do the fancy things when you can build off basic stuff.
The "while" condition is proper (consulted my previous text from years ago) and the output file is named the way I want. The output of this program is filename.OUT.DAT.
I believe the error may lie in the do-while loop, but I'm not sure. When I run the program, It outputs infinitely more line-numbers than there are lines to the console, but nothing to the file. The output file IS created, though.