Hi,
I want to be able to use std stream objects to manipulate files, but some of the files are too big. I want to be able to do the folowing:
>int64_t fileSize;
>strm.seekg(0,ios::end);
>fileSize = static_cast<int64_t>(strm.tellg());
>cout<<"File size is "<<fileSize;
This code will output -1 if the size of the file is too large to fit into an int type.
The reason I am type casting is that tellg() and other related stream functions return the streampos type. My problem is that the streampos type, which is equivalent to an int, is not big enough to contain the size of my file types. I need the int64_t for that.
thanks.