Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int sizeFile(const string path)
- {
- fstream fs;
- fs.open(path, fstream::in | fstream::out | fstream::app);
- if (!fs.is_open())
- {
- throw file_not_found("Error! File not found!");
- }
- else
- {
- fs.seekg(ios::end);
- int length = fs.tellg();
- return length;
- }
- fs.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment