单选题设有以下类和对象的定义: class A
{public: int m; }; A
k1,k2,*p1,*p2; 则下面针对成员变量m的引用,错误的是{{U}} {{/U}}。
A.k1.m=1
B.k2→m=2
C.p1→m=3
D.(*p2).m=4
单选题为了使模块尽可能独立,要求
____
。
单选题有以下程序: #include <iostream> using namespace std; int main() int x; for(int i=1;i<=100;i++) x=i; if (++x%2==0) if (++x%3==0) if (++x%7==0) cout<<x<<","; cout<<end1; return 0; 执行后输出结果是( )。
单选题在下列对字符数组进行初始化中,( )是正确的。
单选题在下列枚举符号中,用来表示“相对于当前位置”文件定位方式的是( )。 A) ios_base::cur B) ios_base::beg C) ios_base::out D) ios_base::end
单选题有如下程序: #include<iostream> using namespace std; class A { public: A(){cout<<"A";} }; class B<public:B(){cout<<"B";)); class C:public A { B b; public: C(){cout<<"C";} }; int main(){Cobj;retum 0;} 执行后的输出结果是
单选题如下程序的输出结果是 #include<lostream> #include<cstring> using namespace std; class XCD{ char*a; int b; public: XCD(char*aa,int bB) { a=new char[strlen(aA) +1]; strcpy(a,aA) ; b=bb; } char*Geta( ){return a;} int Getb( ){return b;} }; int main( ){ char*pl="abcd",*p2="weirong": int dl,6,d2=8; XCD x(pl,d1),y(p2,d2); cout<<strlen(x.Geta( ))+y.Getb( )<<endl; return 0; }
单选题下列线性链表的叙述中,正确的是______。
单选题下列语句中,正确的是( )。
单选题下列程序的输出结果是( )。 #include< iostream.h> void main() {double d=3.2; intx, y: x=1.2; y=(x+3.8)/5.0 cout<<y*d <<endl;}
单选题通过运算符重载,可以改变运算符原有的( )。
单选题下列关于栈的叙述正确的是
单选题下列关于swith语句的描述中,正确的是( )。
单选题在多继承中,公有派生和私有派生对于基类成员在派生类中的可访问性与单继承的规则( )。 A) 完全相同 B) 完全不同 C) 部分相同,部分不同 D) 以上都不对
单选题有如下程序:
#include<iostream>
using namespace std;
int i=1;
class Fun {
public:
static int i;
int value() {return i-1;}
int value()const {return i+1;}
};
int Fun::i=2;
int main() {
int i=3;
Fun fun1;
const Fun fun2;
return 0;
}
若程序的输出结果是:
123
则程序中下画线处遗漏的语句是______。
单选题下列程序的输出结果是 #include class Myclass {
public:Myclass(int i=0,intj=0) { x=i;
y=j; } void show( ) { cout < < "x=" < < x
< < " " < "y=" < < y < < end1;} void show( )const { cout < < "x=" <
< " " < < "y=' < < y < < end1;} privated:
int x; int y; }; void main(
) { Myclass my1(3,4); const my2(7,8);
my1.show( );my2.show( );}
单选题以下程序段的执行结果为( )。 #include< iostream.h> #definePLUS(x,y) x+y void main () {int x=1,y=2,Z=3,sum: sum=PLUS (x+y,Z) * PLUS (y,Z): cout<<"SUM="<<sum; cout<<endl:}
单选题已知数组arr的定义如下: int arr[5]={1,2,3,4,5}; 下列语句中输出结果不是2的是( )。
单选题有下列程序: #include<stdio.h> int f(int x) int y; if(x==0||x==1)return(3); y=x*x-f(x-2); return y; void main() int z; z=f(3);printf("%d/n",z); 程序的运行结果是( )。
单选题有如下程序:
#include<iomanip>
#include<iostream>
using namespace std;
int main(){
cout<<setfill('*')<<setw(6)<<123<<456;
return 0;
}
运行时的输出结果是( )。