int t;char *s1="abc";char *s2="aabdfg"; t=strcmp(s1,s2); 请问t等于多少

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/12 14:08:55
int t;char *s1=

int t;char *s1="abc";char *s2="aabdfg"; t=strcmp(s1,s2); 请问t等于多少
int t;char *s1="abc";char *s2="aabdfg"; t=strcmp(s1,s2); 请问t等于多少

int t;char *s1="abc";char *s2="aabdfg"; t=strcmp(s1,s2); 请问t等于多少
t=1.
函数 strcmp 比较两个字符串的“大小”.即:两个字符串自左向右逐个字符相比(按ASCII值大小相比较),直到出现不同的字符或遇'\0'为止.当s10 .本例中 s1 > s2,所以返回大于零的值 1.