This topic is now archived and is closed to further replies.



Recommended Posts

sop3k    122
Hello!!! How can I print on the screen the __int 64 variable because the code like that: #include......... __int64 variable; int main() { varaible=987654321987; cout<>varaible; } but this dosen''t work.Why???? Thanx for answer and sorry for my Ugly english!!!!!!! With the best regards Sopek

Share this post

Link to post
Share on other sites
Matt Calabrese    122
You can''t use the standard insertion and exraction operators with the ostream/istream classes because the left and right shift operators are not overloaded to display the __int64 datatype.

If you wanted to be able to do such a thing, you would have to overload the << and >> operators to something like:

ostream& operator<<( ostream& os, const __int64 value );

istream& operator>>( istream& os, __int64& variable );

The problem is that for the definition you''d probably end up having to cast the __int64 data into a datatype that already has an associated overloaded operator. Otherwise, you''ll have to do a little more code to be able to display the value using the same syntax.

Matthew Calabrese
Realtime 3D Orchestra:
Programmer, Composer,
and 3D Artist/Animator
"I can see the music..."

Share this post

Link to post
Share on other sites
This topic is now closed to further replies.