I'm developing in c++ but yet need to use FILE * from c (I know fstream option) I want to read line by line
string str;
char* line;
while(!feof(file) && FIleLength(file)>0 && fgets(line, 1024, file))
{
str=line;
str.append("hi");
fputs(str.c_str(),file)
}
I have a few concerns:
1) What if my line is over 1024 chars????????? how should I fix my code to handle that situstion
2)Do I need all these checks feof + size + fgets
3) if I want to use fgets but do not want to use char* line
what c++ type can I use and yet use fgets ()with any convertion probably