Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
You may receive an "error C2593: 'operator <<' is ambiguous" error message when you try to pass an __int64 variable to the ostream operator <<
Article ID: 168440 - View products that this article applies to.
This article was previously published under Q168440
If you try to pass an __int64 variable to the ostream operator <<, you get the following error:
error C2593: 'operator <<' is ambiguous
There is no operator << for __int64 type defined for the ostream class.
Define your own version of operator <<. The following sample code section shows a simple solution for << operator that converts the __int64 variable to a char * type and passes it to the ostream << operator.
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
This problem was corrected in Microsoft Visual C++ .NET.
The following sample program demonstrates the problem and workaround:
Article ID: 168440 - Last Review: May 26, 2005 - Revision: 3.0