For some reason the function below clears my entire file. I don't know if getline() clears what it gets or if something is wrong with my code. Either way, I need to figure out a way to count the lines without wiping out my file. Thanks!
PHP Code:
void lines(){
File.open("data.txt",ios::in);
if (File.is_open()){
while(1){
if (EOF == File.peek()){
break;
}
oflines++;
File.getline(TempInLine, 256);
}
}
File.close();
}