设有 static char str[]="Beijing"; 则执行 printf("%d\n",strlen(strcpy(str,"China"))); 后的输出结果为_______。A.5B.7C.12D.14

设有 static char str[]="Beijing"; 则执行 printf("%d\n",strlen(strcpy(str,"China"))); 后的输出结果为_______。

A.5

B.7

C.12

D.14


相关考题:

有以下程序: includemain(){ char str[][20]={"Hello","Beijing"},*p=str;printf("% 有以下程序: # include<string.h> main() { char str[][20]={"Hello","Beijing"},*p=str; printf("%d\n",strlen(p+20)); } 程序运行后的输出结果是 ______。A.0B.5C.7D.20

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

有以下程序:includemain(){ char str[][20]={"Hello","Beijing"),*p=str[0];printf(" 有以下程序: #include<string.h> main() { char str[][20]={"Hello","Beijing"),*p=str[0]; printf("%d\n",strlen(p+20)); } 程序运行后的输出结果是( )。A.0B.5C.7D.20

有以下程序:includemain(){charstr[][20]={"Hello","Beijing"}*p=str;printf("%\n",s 有以下程序: #include <string.h> main() { char str[][20]={"Hello","Beijing"}*p=str; printf("%\n",strlen(p+20)); } 程序运行后的输出结果是A.0B.5C.7D.20

有以下程序includemain(){charstr[][20]={"Hello","Beijing"},*p=str;printf("%d\n", 有以下程序 #include <string.h> main() {char str[][20]={"Hello","Beijing"},*p=str; printf("%d\n",strlen(p+20)); } 程序运行后的输出结果是A.0B.5C.7D.20

以下程序运行后的输出结果是______。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;}

有以下程序inculde stdio.hinculde string.hvoid Fun(char*str){ char temp;int n,I;n=strlen(str);temp=str[n-1];For(i=n-1;i0;i--) str[i]=str[i-1];str[0]=temp;}main(){ char s[50];ScanF(“%s”,s);Fun(s);printF(“%s\n”,s);}程序运行后输入:aBcDeF<回车>,则输出结果是【 】

设有说明语句如下: static char str[]="Beijing"; 若执行下列输出语句: printf("%d\n",strlen(strcpy(str,"China")));则输出结果为( )。A.5B.7C.12D.14

下面的程序各自独立,请问执行下面的四个TestMemory 函数各有什么样的结果?①void GetMemory(char * p){p = (char * )malloc(100);}void TestMemory (void){char *str = NULL;GetMemory (str);strcpy(str, "hello world");prinff(str);}② char * GetMemory (void){char p[ ] = "hello world";return p;}void TestMemory (void){char * str = NULL;str = GetMemory( );printf(str);}③void GetMemory(char * * p, int num){* p = (char * )malloc(num);}void TestMemory (void){char * str = NULL;GetMemory(str, 100);strcpy( str, "hello" );printf(sir);}④void TestMemory (void){char *str = (char * )malloe(100);strepy (str, "hello" );free ( str );if(str ! = NULL){strepy( str, "world" );printf(str);}}