no match for operator<< in std::cout
Sep 5, 2010 at 5:58am UTC
I have a really small snippet of code here:
1 2 3 4 5 6 7 8
void attack()
{
system("CLS" );
cout<<Hero.getDmg<<" attacks!\n\n" ;
Sleep(100);
cout<<mon.getNaam<<" took " <<Hero.getDmg<<" damage!" ;
}
The problem is, it can't compile because it syas: no match for operator<< in std::cout. I've never encountered this problem before. Hero is a global object.
Sep 5, 2010 at 6:26am UTC
It should be Hero.getDmg()
(don't forget the parentheses). Same for the others.
Sep 5, 2010 at 10:41am UTC
Omg I'm making so silly mistakes lately...
Thanks!
Topic archived. No new replies allowed.