I wanted to compare a string without actually defining one of them as a string, something like this,
if (string == \"add\")
Do I have to de
You could use strcmp():
strcmp()
/* strcmp example */ #include #include int main () { char szKey[] = "apple"; char szInput[80]; do { printf ("Guess my favourite fruit? "); gets (szInput); } while (strcmp (szKey,szInput) != 0); puts ("Correct answer!"); return 0; }