网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
以下与库函数strcmp(char *s, chat *t)的功能相等的程序段是()。

A.strcmp1(char *s, chat *t)

{ for ( ;*s++==*t++ ;)

if (*s=='\0') return 0

return (*s-*t)

}

B.strcmp2(char *s, char *t)

{ for( ;*s++==*t++ ;)

if (!*s) return0

return (*s-*t)

C.strcmp3(char *s, char *t)

{ for ( ;*t==*s ;)

{ if (!*t) return 0

t++

s++}

return (*s-*t)

}

D.strcmp4(char *s, char *t)

{ for( ;*s==*t;s++,t++)

if (!*s) return 0

return (*t-*s)

}


参考答案

更多 “ 以下与库函数strcmp(char *s, chat *t)的功能相等的程序段是()。 A.strcmp1(char *s, chat *t){ for ( ;*s++==*t++ ;)if (*s=='\0') return 0return (*s-*t)}B.strcmp2(char *s, char *t){ for( ;*s++==*t++ ;)if (!*s) return0return (*s-*t)C.strcmp3(char *s, char *t){ for ( ;*t==*s ;){ if (!*t) return 0t++s++}return (*s-*t)}D.strcmp4(char *s, char *t){ for( ;*s==*t;s++,t++)if (!*s) return 0return (*t-*s)} ” 相关考题
考题 以下与库函数strcpy(char *p, char *q)功能不相等的程序段是()。 A.strcpy1(char *p, char *q){ while ((*p++=*q++)!='\0')}B.strcpy2( char *p, char *q){ while((*p=*q)!='\0'){p++ q++}}C.strcpy3(char*p, char *q){ while (*p++=*q++)}D.strcpy4(char *p, char *q){ while(*p)*p++=*q++}

考题 函数sstrcmp()的功能是对两个字符串进行比较。当s所指字符串和t所指字符串相等时,返回值为0;当s所指字符串大于t所指字符串时,返回值大于0;当s所指字符串小于t所指字符串时,返回值小于0(功能等同于库函数strcmp()),请填空。#includestdio.hint sstrcmp(char *s,char *t){ while(*s*t*s= =){s++;t++; }return;}

考题 以下函数的功能对应于 int fun(char *s,char *t) { while (*s) s++; } return(*s-*t); } A.strlen(s)+strlen(t)B.strcmp(s,t)C.strcpy(s,t)D.strcat(s,t)

考题 下列程序的运行结果是()。includeincludemain(){ char*s1="ahDuj";char*s2= 下列程序的运行结果是( )。#include<stdio.h>#include<string.h>main(){ char*s1="ahDuj"; char*s2="ABdUG": int t; t=strcmp(s1,s2); printf("%d", t);}A.正数B.负数C.零D.不确定的值

考题 下列程序的运行结果是()。includeincludemain(){char*s1="abDuj"; char*s2= 下列程序的运行结果是( )。 #include<stdio.h> #include<string.h> main() { char*s1="abDuj"; char*s2="ABdUG"; int t; t=strcmp(s1,s2); printf("%d",t); }A.正数B.负数C.零D.不确定的值

考题 下列程序的运行结果是()。 include include main() {char*s1="abDuj"; char 下列程序的运行结果是( )。#include<stdio.h>#include<string.h>main(){ char*s1="abDuj";char*s2="ABdUG";int t;t=strcmp(s1,s2) ;printf("%d",t);}A.正数B.负数C.零D.不确定的值

考题 下面程序的运行结果是()。includeincludemain(){char*s1="abDuj";char*s2=" 下面程序的运行结果是( )。 #include<stdio.h> #include<string.h> main() {char*s1="abDuj"; char*s2="ABdUG"; int t; t=strcmp(s1,s2); printf("%d",t); }A.正数B.负数C.零D.不确定的值

考题 函数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 【 】;}

考题 【单选题】C语言的库函数即有大量指针函数,以下属于指针函数的是()。A.int puts(char *s)B.char *gets(char *s)C.int strcmp(char *s,char *t)D.int fgetc(FILE *fp)