How to compare string with const char*?
Posted
by arzeth
on Stack Overflow
See other posts from Stack Overflow
or by arzeth
Published on 2010-05-28T18:52:46Z
Indexed on
2010/05/28
19:02 UTC
Read the original article
Hit count: 127
c++
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
string cmd;
while(strcmp(cmd.c_str(),"exit")==0 && strcmp(cmd.c_str(),"\exit")==0)
{
cin>>cmd;
cout<<cmd;
}
return 0;
}
I am stuck.
© Stack Overflow or respective owner