Use strcmp
.
This is in string.h
library, and is very popular. strcmp
return 0 if the strings are equal. See this for an better explanation of what strcmp
returns.
Basically, you have to do:
while (strcmp(check,input) != 0)
or
while (!strcmp(check,input))
or
while (strcmp(check,input))
You can check this, a tutorial on strcmp
.