hey... i'm working on a combat system
and getthis error....
Error 1 error C2446: '==' : no conversion from 'const char *' to 'int' c:\users\www\documents\visual studio 2008\projects\combatsystem\combatsystem\combatx.cpp 30 CombatSystem
and this is my code....
How am I supposed to know which line is line 30 if you don't post all of the code?
How am I supposed to guess which line is causing the error if I can't read your code?
Thank you. As it happens the error is on line 31, here: if(command == "A")
You seem to misunderstand the difference between a character literal and a string literal. A character literal is a single character and can be stored in an int; with char being a 1 byte integer used for storing single ASCII characters. A character literal is a single character enclosed in inverted commas: ' and '. A string literal is a group (or string) of characters enclosed in quotation marks: " and ".
What you've done is put a character literal in quotation marks instead of using inverted commas. Because of that, it's like you're comparing a constchar* (which is a C string) with a char. A char can't be compared with a "C-string", so you get that error.