So this one sounds very easy but I am getting some strange behavior.
In my program there is the following code:
std::cout << "Would you like to generate a complexity graph or calculate global complexity? (graph/global)\n";
char ans[6];
std::cin >> ans;
if (ans != "global") std::cout << ">>" << ans << "<<" << std::endl;
When I run my program and type in "global" when I'm prompted for input, the program returns:
>>global<<
Why does the if statement evaluate as true
?