Hello. I'm writing program wich reads from file line by line and then rewrites everything to other file. This is simplifyied part of code:
for (int i=0; i<=5;) {
getline (file1, str1); /* file1 is file from wich i read and str1 is string*/
file << str1;
}
No i'm not copying file :) Between reading and writing i'm working with lines and rewriting to other file reformed text. But the problem is that i don't know how many lines are in file. So i need to catch file end to break loop. Please help me to catch file end. Thank you :)