I am trying to get my while loop to break whenever "action" equals "CE".
while(1){
scanf("%s\n", action);
if(strcmp(action, "CE")==0){
break;
...
}
However, when I input "CE", my loop doesn't break but instead runs through my while loop and then breaks after asking me for an "action" input again.
Why is it doing this and how to I get it to break immediately after the scanf statement?