So the task is to sort the list numerically and alphabetically. I used strtok to divide into tokens. I am getting stuck using strmp.
Can anyone give a clue to use strcmp?
If some s1 and s2 were integers, you'd check that s1 < s2. Now, instead you have to check that strcmp(s1, s2) == -1.
Although I don't get what you're doing. list<char> is a list of letters. You either wanted string or list<string>. Also, if you can use string class, you don't need strcmp (in fact, you can't use it at all). Usual operators <, <=, etc work for strings.
If some s1 and s2 were integers, you'd check that s1 < s2. Now, instead you have to check that strcmp(s1, s2) == -1.
I don't think it is guaranteed that strcmp will return -1 if s1 compares less than s2. Instead check if the returned value is less than 0 strcmp(s1, s2) < 0.