How to compare string with const char*?

前端 未结 6 1920
一生所求
一生所求 2021-02-19 06:20
#include 
#include 
#include 
#include 
using namespace std;
int main()
{
        string cmd;
        whil         


        
6条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-19 07:20

    The condition in your while will never evaluate to true because you're testing to check the cmd string is equal to "exit" and "\\exit". One string can never be equals to two values at the same time.

提交回复
热议问题