I understand that if you have \'cat\' (string1) and \'dog\' (string2) in strcmp (this is a C question) then the return value of strcmp would be less than 0 (since \'cat\' is lex
It returns the difference at the octet that differs. In your example '\0' < '2' so something negative is returned.
'\0' < '2'