/* see if user wants to stop */
if (!strcmp (command, "quit")) break;
What is the use of "!" here??
Answers
Answered by
1
Answer:
Here "!" is a logical not operator that returns an integer 0 when two
strings don't match and returns 1 (or might be some other integer x>0) which
if 2 strings are equal. Since the code compares strings in a *lexicographic* way
i.e. character by character, '!' takes the 0 integer value and evaluates as true
and 1 as false. It then checks whether command is equal to "quit" and if it is
not equal then enter the loop and execute all statements and if it is then skip
the if statement.
Reference:
for more info on:-
logical operators
https://brainly.in/question/10874212
loops
https://brainly.in/question/2359999
Similar questions