error: switch quantity not an integer

后端 未结 7 897
你的背包
你的背包 2020-12-11 02:11

I have researched my issue all over StackOverflow and multi-google links, and I am still confused. I figured the best thing for me is ask...

Im creating a simple co

7条回答
  •  余生分开走
    2020-12-11 02:23

    Strings cannot be used in switch statements in C++. You'll need to turn this into if/else if, like this:

    if (command == "tan")
    {
        // ...
    }
    else if (command == "cos")
    {
        // ...
    }
    // ...
    

提交回复
热议问题