Im in the process of trying to recreate a piece of python code for a simple calculator in C++,
in python i have the following piece of code thats located in a while loop
func = str(input("which function: add, sub, div, mult"))
if func in ("add", "sub", "div", "mult"):
#secondery if statment
else:
print("error")
how would i go about writing if func in ("add", "sub", "div", "mult"): in C++?
i have tried
if (func in {"add", "sub", "div", "mult"}){
//secondery if statment
else:
std::cout << "error \n";
}
but this doesn't work.