Is there a function out there that will return the size of a file?
ifstream fin;
fin.open("filename");
want to get file size of input file?
do some things with size of file.
fin.close();
Printable View
Is there a function out there that will return the size of a file?
ifstream fin;
fin.open("filename");
want to get file size of input file?
do some things with size of file.
fin.close();
use seekp or seekg to get to the end of the file.
use tellp or tellg to get the filelength.
fin.seekp(0,ios::end);
filelength= fin.tellp(); // number of bytes in file.