strcmp, strtok
int strcmp(char const *s1, char const *s2);Beginners mistake:if ( strcmp(a, b) ) …If a == b then strcmp(a,b) == 0 !!!If a > b strcmp(a,b) > 0 (and < 0 if a<b)(return value is not 1 or -1 )
char *strtok(char *s1, const char *s2);searches for tokens in s1 using token- separators given in s2. Example:void print_tokens(char *line) { char whitespace[] =“ \t\f\r\v\n”; char *token; for (token=strtok(line,whitespace); token !=NULL; token=strtok(NULL,whitespace)) printf(“Next token is %s\n”, token);}