Sign in to follow this  

Error C2593

Recommended Posts

Hey guys.

I am doing the last program in beginning c++ though game programming and i have come across a compile error (in title). D=

The error is "error C2593: 'operator <<' is ambiguous"

here is the function that the error is in. I hope this enough to help but if its not i will most more later. This is a friend function to a class (GenericPlayer)
[code]ostream& operator<<(ostream& os, const GenericPlayer& aGenericPlayer){
os << aGenericPlayer.m_Name << ":\t";

vector<Card*>::const_iterator pCard;
for(pCard = aGenericPlayer.m_Cards.begin(); pCard != aGenericPlayer.m_Cards.end(); ++pCard){
os << *(*pCard) << "\t"; // this is the line of code with the error. It is the first << operator
if(aGenericPlayer.GetTotal() != 0){
cout << "(" << aGenericPlayer.GetTotal() << ")";
os << "<empty>";
return os;

Thanks for the help

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this