填空题
函数strcmp( )的功能是对两个字符串进行比较,当s所指字符串和t所指字符串相等时,返回值为0; 当s所指字符串大于t所指字符串时,返回值大于0;当s所指字符串小于t所指字符串时,返回值小于0(功能等同于库函数strcmp( ) ),请填空。
#include <stdio.h>
int strcmp ( chat * s, char * t)
{ while( * s && * t && * s=【 】
{ s++;t++; }
return【 】;
)
【参考答案】
* 或t[0]
热门
试题
填空题
以下程序的输出结果是 _________。main(){ int a[3][3]={{1,2,9},{3,4,8},{5,6,7}},i,s=0; for(i=0;i<3;i++) s+=a[i][i]+ a[i][3-i-1]; printf( %d n ,s);}