How to compare string with const char*?
- by arzeth
#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.