size of file

hi coders,
Recently an idea struck my mind to create a file cutter.What it does is to read info from a file and split it into files with specific size and delete the original.If the user requires it should also join splitted pieces back.I have created an algorithm.But I meed a way to find the size of the file.I there a function for it or do we have to create a user defined function
note::i would also like to know if there is a way to keep record of created files like by numbering them
thanks for reading my query,
Cyber Dude
There's an example on this site of getting the length of a file (among other things): http://www.cplusplus.com/reference/istream/istream/seekg/

In a nutshell: seekg to the end of the file, then use tellg to get the length. You'll probably want to seekg back to the beginning of the file afterwards, too.

As for numbering files, you can read up on how to convert numbers to strings here: http://www.cplusplus.com/articles/D9j2Nwbp/
ok thanks
Topic archived. No new replies allowed.