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

题目内容 (请给出正确答案)
单选题
设有char *s="ABCDE";cout<< strlen(s)<< endl;输出结果是()
A

6

B

5

C

4

D

1


参考答案

参考解析
解析: 暂无解析
更多 “单选题设有char *s="ABCDE";cout strlen(s) endl;输出结果是()A 6B 5C 4D 1” 相关考题
考题 以下程序的输出结果是【】。 include using namespace std; int main() {char S[]="abcde 以下程序的输出结果是【 】。include <iostream>using namespace std;int main(){char S[ ]="abcdef";s[3]='\0';cout<<s<<end1;return 0;}

考题 下列程序的输出结果是______。 include include using namespace std; voi 下列程序的输出结果是______。include<iostream.h>include<string.h>using namespace std;void fun(const char*s,char C) {c=s[strlen(s)/2];}int main(){char str[]="ABCDE";char ch=str[1];fun(str,ch);cout<<ch;return 0;}

考题 有如下程序段:char C[20]="examination";C[4]=0;cout<<c<<endl;这个程序的输出结果是______。

考题 下列程序时类D代码段出现编译错误,原因是【 】。 include class A { public:A(char c) 下列程序时类D代码段出现编译错误,原因是【 】。include<iostream. h>class A{public:A(char c){cout<<"A's constructor."<<c<<endl;}~A(){cout<<"A's destructor."<<endl;}};class B: virtual public A{public:B(char cb,char cd):A(cb) {cout<<"B's constructor."<<cd<<endl;}~B(){cout<<"B's destructor."<<endl;}private:char b;};class C:virtual public A{public:C(char cc, char cd):A(cc){cout<<"C's constructor. "<<cd<<endl;}~C(){cout<<"C's destructor."<<endl;}};class D:public B,public C{public:D(char cd,char ce,char cf, char cg, char ch,char ci):C(cf,cg),B(cd,ce),A(cd),aa(ch){cout<<"D's constructor."<<ci<<endl;}~D() {cout<<"D's destructor."<<endl;}private:A aa;};void main(){D ohj('a','b','c','d','e','f')}

考题 以下程序的输出结果是【】。 include include void main 0 { char s[50]; st 以下程序的输出结果是【 】。include<iostream.h>include <string.h>void main 0 {char s[50];strcpy(s[O], "No" );strcpy(s[1], "123" );strcpy (s[2], "23456" );cout<<s;}

考题 以下程序段的输出结果是 char s[]="\\141\141abc\t"; printf ("%d\n",strlen(s));A.9B.12C.13D.14

考题 请将下面的程序补充完整,使得程序输出“飘是张娜的书”。includeusing namespace stdclass Book{public:Book(char*str)|strcpy(title,str);______void Printlnfo(){cout<<title<<endl;}protected:char title[50];};class MyBook:public Book{public:MyBook(char*s1,char*S2=“张娜”):______strcpy(owner,s2);}virtual void PrintInfo(){cout<<title<<“是”<<owner<<“的书”<<endl;}private:charowner[10];};int main(){Book*ptr=new MyBook(“飘”);ptr-Printlnfo();return 0;}

考题 以下程序的输出结果是()。includevoid func(char**m) {++m:cout 以下程序的输出结果是( )。 #include<iostream.h> void func(char**m) { ++m: cout<<*m<<endl; } void main() { static char*a[]={"MORNING","AFTERTOON","EVENING"}; char**n; n=a: func(n); }A.为空B.MORNINGC.AFTERTOOND.EVENING

考题 下面程序段的运行结果是 include void main( ) {char*s="abcde"; S+=2; 下面程序段的运行结果是 #include<iostream.h> void main( ) { char*s="abcde"; S+=2; cout<<s;}A.cdeB.字符'c'C.字符'c'的地址D.无确定的输出结果

考题 以下程序的输出结果是()。includeusing namespace std;void fun(char**q){++q;cout 以下程序的输出结果是( )。 #include<iostream> using namespace std; void fun(char**q) { ++q; cout<<*q<<end1; } main() { static char*s[]={"HI","HELL0","TEST"}; char**p; p=s; fun(p); system("PAUSE"); return 0; }A.为空B.HIC.HELL0D.TEST

考题 以下程序的输出结果是______。includeincludefun(char*w,int n){ char t,*s 以下程序的输出结果是______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++; *s1=*s2-; *s2=t; } } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }A.1234567B.7654321C.1711717D.7177171

考题 以下程序的输出结果是______。includeincludefun(char *w,int n){ char t,* 以下程序的输出结果是______。 #include<stdio.h> #include<siring.h> fun(char *w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++; *s1=*s2-; *s2=t; } } main() { char *p; p="1234567"; fun(p,strlen(p)); puts(p); }A.1234567B.7654321C.1711717D.7177171

考题 以下程序运行后输入:3,abcde回车,则输出结果是【 】include move(char *str, 以下程序运行后输入:3,abcde回车,则输出结果是【 】include <string.h>move(char *str, int n){ char temp; int i;temp=str[n-1];for(i=n-1;i>0;i--) str[i]=str[i-1];str[0]=temp;}main( ){ char s[50]; int n, i, z;scanf("%d,%s",n,s);z=strlen(s);for(i=1; i<=n; i++) move(s, z);printf("%s\n",s);}

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

考题 以下程序的输出结果是()。includeint fun (char*s){char *p=s;while (*p!='\0,) p++ 以下程序的输出结果是( )。 #include<iostream.h> int fun (char*s) { char *p=s; while (*p!='\0,) p++: return (p-s): } void main() { cout<<fun (" ABCDEF ")<<endl: }A.3B.6C.8D.0

考题 以下程序的输出结果是_______。includemain(){char*a="abcdefghi";int k;fun(a) ;puts 以下程序的输出结果是_______。 #include<string.h> main() {char*a="abcdefghi";int k; fun(a) ;puts(a) ; } fun(char *s) { int x,y; char c; for(x=0,y=strlen(s)-1; x<y; x++,y--) { c=s[y]; s[y]=s[x];s[x]=c;} }A.ihgfedcbaB.abcdefghiC.abcdedcbaD.ihgfefghi

考题 设有定义:char s[12]={"hello"},则cout<<strlen(s)的输出是 ______。A.5B.6C.11D.12

考题 下列程序的输出结果是______。#includemain(){ char *a="abcdefghi";int k; fun(a);puts(a);}fun(char*s){ int x,y;char c; for(x=0,y=strlen(s)-1;x<y;x++,y--) { c=s[y];s[y]=s[x];s[x]=c;}}A.ihgfsdcbaB.abcdcfghiC.abcdedebaD.ihgfefghi

考题 以下程序的输出结果是【 】。char s[ ]="XYZQ";void main(){char *p;for(p = s; p < s+4; p++)cout<<p<<end1;}

考题 以下程序运行后的输出结果是【】。 include void main(){char s[]=“123456”,*p;for(p=s 以下程序运行后的输出结果是【 】。include<iostream.h>void main(){char s[]=“123456”,*p;for(p=s; p<s+2; p++)cout<<p<<end1;}

考题 以下程序的输出结果是______。 include main() { char*a="abcdefghi";int k fun(a);p 以下程序的输出结果是______。 #include <string.h> main() { char*a="abcdefghi";int k fun(a);puts(a); } fun(char*s) { int x,y; char c for(x=0,y=strlen(s)-1;x<y:x++,y--) {c=s[y];s[y]=s[x];s[x]=c;} }A.ihgfedcbaB.abcdefghiC.abcdedebaD.ihgfefghi

考题 设已执行预编译命令include,以下程序段的输出结果是()。char s[]="an apple";printf(" 设已执行预编译命令#include<string.h>,以下程序段的输出结果是( )。 char s[]=" an apple" ; printf(" %d\n" ,strlen(s));A.7B.8C.9D.10

考题 设有定义:"char s[12]={"string"};" 则printf("%d\n",strlen(s));的输出是( )A.6B.7C.11D.12

考题 以下程序段的输出结果是()。     char s[]= “\\140\140abc\t”;       prntf(“%d\n”,strlen(s));

考题 设有char *s="ABCDE";cout strlen(s) endl;输出结果是()A、6B、5C、4D、1

考题 设有char *s="ABCDE";cout (s+1) endl;输出结果是()A、AB、BC、ABCDD、BCD

考题 填空题以下程序段的输出结果是()。    Char s[]I=”/1238/080abc”;    printf(”%d/n”,strlen(s));