What's wrong with this?
The if statement will not execute. :(Code:char cmd[80];
cin.getline(cmd, 80);
if (cmd == "help") {
cout << "No help available." << endl;
}
Printable View
What's wrong with this?
The if statement will not execute. :(Code:char cmd[80];
cin.getline(cmd, 80);
if (cmd == "help") {
cout << "No help available." << endl;
}
i believe it is because you cannot do cmd=="help", not sure though.
edit:: http://cboard.cprogramming.com/showt...threadid=31971
Then what can you do?
sorry, edited my post after you posted.
no problem, I see it, strcmp. thanks.
you're welcome.:)