C语言 strcmp("how","How")的值是什么

日期:2021-06-04 17:17:16 人气:1

C语言 strcmp("how","How")的值是什么

strcmp函数原型:extern int strcmp(const char *s1,const char * s2);
比较两个字符串。若str1==str2,则返回零;若str1>str2,则返回正数;若str1<str2,则返回负数。
因为‘h’的ASCII码值为104,而‘H’的ASCII码值为72,即“how” > "How",所以返回值为正数。
    A+
热门评论