I opened the file in binary mode, and doing the below operations gives a negative x value. The file I opened is ~ 2.5 GB in size.
infile.seekg(0, ios::end); __int64 x = infile.tellg();
I needed an infile to read bytes (unsigned chars), so I defined it as uifstream by doing:
typedef basic_ifstream<unsigned char, std::char_traits<unsigned char> > uifstream;
which is basically a standard ifstream, but with unsigned chars instead of chars .
EDIT: I am using Visual Studio 2005 and fixed uofstream for uifstream.
source share