0
Question on Files and Pointers. Put and Get pointers.
ofstream outfile; outfile.open("result.txt", ios::app); int p=outfile.tellp(); cout<<p<<endl; outfile.close(); I have a "result" file in the folder, where there is so much content, yet the program doesn't seem to return the number of bytes associated in the file. WHY?
2 Respuestas
0
use seekg with parameter end to set cursor pointer to end of the file, and then call function tellg
0
outfile.seekg(0, ios::end);
int fz = outfile.tellg();
cout<< fz;