我的代码量非常少:
int test = strcmp("Websecurity", "easily");
printf("%d\n", test);
结果是-1。为什么?显然 'W' 大于 'e'?
最佳答案
在 ASCII 中大写字母排在小写字母之前,所以 'W' < 'e'
.
关于c - `strcmp` 的返回值的顺序是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28332788/