有如下程序段:
char C[20]="examination";
C[4]=0;
cout<<c<<endl;
这个程序的输出结果是______。
第1题:
若有如下程序段:
include <iostream>
using namespace std;
int main()
{
char *p="abcdefgh",*r;
long *q;
q=(long *)p;q++;
r=(char *)q;
cout<<r<<end1;
return 0;
}
该程序的输出结果是______。
第2题:
下面程序输出的结果是( )。 #include<iostream> using namespace std; int fuc (char *x); int main(){ cout<<fuc("hello")<<endl; return 0; } int fuc(char *x){ char *y=x; while(*y! ='\0')y++; return(y-x); }
A.5
B.6
C.0
D.语法错误,不能输出结果
第3题:
【单选题】请读程序段:short int i=65536; cout<<i<<endl; 上面程序段的输出结果是_____。
A.65536
B.0
C.有语法错误,无输出结果
D.-1
第4题:
以下程序的输出结果是( )。 #include<iostream.h> int fun (char*s) { char *p=s; while (*p!='\0,) p++: return (p-s): } void main() { cout<<fun (" ABCDEF ")<<endl: }
A.3
B.6
C.8
D.0
第5题:
有如下程序: #inClude<iostream> using namespaCe std; Class test{ private: int a; publiC: test( ){Cout<<”ConstruCtor”<<endl;} test(int A.{Cout<<a<<endl;} test(Const test&_test){ a=test.a: Cout<<”Copy ConstruCtor”<<endl: } test( ){Cout<<”destruCtor”<<endl;} }; int main( ){ test A(3); return 0; } 执行这个程序的输出结果是( )。
A.3
B.ConstruCtor destruCtor
C.Copy ConstruCtor destruCtor
D.3 destruCtor