Ambiguous behaviour of strcmp()
问题 Please note that I have checked the relevant questions to this title, but from my point of view they are not related to this question. Initially I thought that program1 and program2 would give me the same result. //Program 1 char *a = "abcd"; char *b = "efgh"; printf("%d", strcmp(a,b)); //Output: -4 //Program 2 printf("%d", strcmp("abcd", "efgh")); //Output: -1 Only difference that I can spot is that in the program2 I have passed string literal, while in program I've passed char * as the