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

题目内容 (请给出正确答案)

当执行以下语句后,函数strlen(str)返回的值是 ( ) static char str[10]={”Change"};

A.10

B.7

C.6

D.11


参考答案

更多 “ 当执行以下语句后,函数strlen(str)返回的值是 ( ) static char str[10]={”Change"};A.10B.7C.6D.11 ” 相关考题
考题 以下程序的输出结果是 _[13]_______ .#include stdio.h#include string.hchar *fun(char *t){ char *p=t;return(p+strlen(t)/2);}main(){ char *str="abcdefgh";str=fun(str);puts(str);}

考题 请补充函数fun(),该函数的功能是判断一个数是否为回文数。当字符串是回文时,函数返回字符申:yes!,否则函数返回字符串:no!,并在主函数中输出。所谓回文即正向与反向的拼写都一样,例如:abcba。注意:部分源程序给出如下。请勿改动主函数main和其他函数中的任何内容,仅在函数fun()的横线上填入所编写的若干表达式或语句。试题程序:include<string.h>include<stdio.h>char *fun(char*str){char *p1,*p2;int i, t=0;p1=str;p2=str+strlen(str)-1;for (i=0;【 】;i++)if(【 】){t=1;break;}if (【 】)return("yes!");elsereturn("no!");}main(){char str[50];printf("Input;");scanf("%s",str);printf("%s\n",fun(str));}

考题 执行下列语句后,输出结果为steven的是char*str="steven";eout.write(str, );A.strlen(str)B.sizeof(str)C.strlen(str+1)D.sizeof(str-1)

考题 以下程序运行后的输出结果是______。includeinclude usingnamespacestd;classY 以下程序运行后的输出结果是______。include <iostream>include <string>using namespace std;class Y;class X{int x;char *strx;public:X(int a, char *str){x=a;strx=new char[strlen(str)+1]strcpy (strx,str);}void show(Y ob);};class Y{prlvate:int y;char *stry;public:Y(int b,char *str){y=b;stry=new char[strlen(str)+1];strcpy(stry,str);}friend void X::show(Y ob);};void X::show{Y ob){cout<<strx<<",",cout<<ob.stry<<endl;}int main{{X a (10, "stringX");Y b (20, "stringY");a. show (b);renurn 0;}

考题 执行下列语句后,输出结果为steven的是 Char * str="steven"; cout. write(str, );A.strlen(str)B.sizeof(str)C.strlen(str+1)D.sizeof(str-1)

考题 有以下程序:include include using namespace std;class Y;class X{private 有以下程序: #include <iostream> #include <string> using namespace std; class Y; class X { private: int x; char *strx; public: X(int a, char *str) { x=a; strx=new char[strlen(str)+1]; strcpy(strx,str); } void show(Y ob) ; }; class Y { private: int y; char *stry; public: Y(int b,char *str) { y=b; stry=new char[strlen(str)+1]; strcpy(stry, str); } friend void X: :show(Y ob) ; }; void X: :show(Y ob) { cout<<strx<<", "; cout<<ob, stry<<end1; } int main ( ) { X a(10,"X"); Y b (20, "Y"); a. show(B) ; return 0; } 执行后的输出结果是( )。A.X,YB.a,bC.X,XD.Y,Y

考题 设char str1[11]="HELLO,",str2[10]=“world”;则执行语句cout 设char str1[11]="HELLO,",str2[10]=“world”;则执行语句 cout<<strlen(strcpy(str1,str2)));后的输出结果是 ______。A.12B.11C.7D.5

考题 以下程序的输出结果是_[13]_______#include stdio.h#include string.hchar *fun(char *t){ char *p=t;return(p+strlen(t)/2);}main(){ char *str="abcdefgh";str=fun(str);puts(str);}

考题 【判断题】函数返回值是指针类型的函数为指针函数,以下是一个指针函数的原型。 char *strcat(char *str1,char *str2)A.Y.是B.N.否