__int64 & error C2593: 'operator <<' is ambiguous
cout doesn''t have a << operator defined for 64 bit ints. There''s your why
As to solving it, I''m not sure. I''ve only used __int64s with *printf so I can''t say how to work around it with cout. I''m very evil with my C/C++ programming and often mix C-style functions with C++ code just to get around issues like this. That''s my best offer; maybe someone else knows a better way?
As to solving it, I''m not sure. I''ve only used __int64s with *printf so I can''t say how to work around it with cout. I''m very evil with my C/C++ programming and often mix C-style functions with C++ code just to get around issues like this. That''s my best offer; maybe someone else knows a better way?
I use unsigned __int64 a great deal in my programs, and the only way I know of to print the value is to use printf() (unless you want to write your own, which isn''t difficult, but might as well use printf then...).
In VC++ you add I64 to printf, as shown above. For instance:
and so on...
I think gcc and maybe the Intel compiler use %ll instead of %I64. So you would do %llu instead of %I64u, etc. You can write some #define''s to handle this so your code will compile in VC++ and gcc if that is needed.
unsigned __int64 i = Some64BitValue();printf("%I64u\n", i);
In VC++ you add I64 to printf, as shown above. For instance:
%d becomes %I64d%u becomes %I64u%x becomes %I64x
and so on...
I think gcc and maybe the Intel compiler use %ll instead of %I64. So you would do %llu instead of %I64u, etc. You can write some #define''s to handle this so your code will compile in VC++ and gcc if that is needed.
quote:Use iostream, not iostream.h
I feel that that had to be repeated.
:::: [ Triple Buffer V2.0 ] ::::
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement