慕妹3146593
strcmp的函数代码实现模拟为如下:#include <stdio.h>int strcmp(char *str1,char*str2){char * p1=str1, *p2=str2;while(*p1 && *p2){if(*p1>*p2){return 1;}else if(*p1<*p2){return -1;}p1++;p2++;}if(*p1==0 && *p2==0){return 0;}else if(*p1==0 && *p2!=0){return -1;}else{return 1;}}void main(){printf("%d\n",strcmp("hello1","hello"));printf("%d\n",strcmp("computer","compare"));printf("%d\n",strcmp("dbase","C Language"));}请自己看代码,也简单。