W
Water Lin
I am using ifstream to read file. But when I read a file about 2.8G, the
ifstream will return a size like these:
------------------
-1358985216
------------------
Here is my code:
-----------------------
string dir = "C:\\test";
uint64 size;
ifstream infile(dir.c_str(), ios::in | ios::binary | ios::ate);
if ( infile.is_open() )
{
size = infile.tellg();
}
---------------------
Why the size will be a negative?
Anything wrong?
Someone told me that I should use a 64bit edition of ifstream, is it
true?
ifstream will return a size like these:
------------------
-1358985216
------------------
Here is my code:
-----------------------
string dir = "C:\\test";
uint64 size;
ifstream infile(dir.c_str(), ios::in | ios::binary | ios::ate);
if ( infile.is_open() )
{
size = infile.tellg();
}
---------------------
Why the size will be a negative?
Anything wrong?
Someone told me that I should use a 64bit edition of ifstream, is it
true?