help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

std::streampos and INT_MAX - incompatible?


From: Al-Burak
Subject: std::streampos and INT_MAX - incompatible?
Date: 22 Dec 2005 07:13:32 -0800
User-agent: G2/0.2

I have a program that retrieves the cursor position at the point where
the data began to be stored, this value is assigned to a
'std::streampos' data type called 'pos'. Later on in the program, 'pos'
is put in another file, but as an 'int' data type, as suggested by the
documentation. Having said that, here is my question: If the value of
'pos' exceeds INT_MAX, I will lose the ability to store that data in an
integral value; run time error kind of thing (at best!), I suspect.
This is most likely to happen since the file size will most definitely
grow to a size bigger than INT_MAX.

Can any pitch in a work around?


Thanks in advance.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]