You can't compare char arrays with the equality operator. Or rather, you can, but it's highly unlikely to work.
strcmp() is used, instead:
1 2 3 4
|
char *s0,*s1;
strcmp(s0,s1)<0 //s0<s1. In other words, s0 should appear first in a dictionary.
strcmp(s0,s1)>0 //s0>s1
strcmp(s0,s1)==0 //s0==s1
|
Remember that strcmp(), as all C string functions, understands that the string ends at the first '\0' from the pointed-to character.
Oh, and a char is not a character literal. A literal is a type of token; a constant entered in the code. For example,
Here there's four types of tokens. Two identifiers (int, a), two operators (=, +), two literals (1234, 'A'), and a syntactical token (;).