Welcome to the forum, avolkmar!
String comparisons in C are done with the strcmp(string1, string2) function. Include the header file <string.h> to use it. The return from strcmp() works like this:
Value > 0 = strcmp(string1, string2) (string1 > string2)
Value < 0 = strcmp(string1, string2) (string1 < string2)
Value of 0 = strcmp(string1, string2) (string1 ==s tring2)
Just remember that the value returned will refer to string1, When string1 is greater, the value returned will be > 0, etc.
Code:
if(strcmp(string1,"stop")== 0) {
break; //break out of the current loop
}