已知函数原型"voidfun(constint&A;",则下列fun函数调用正确的是()。
AintX=3;fun(x);
B)constinty=3;fun(y);
Cfun(3);
D以上三种都正确
AintX=3;fun(x);
B)constinty=3;fun(y);
Cfun(3);
D以上三种都正确
第1题
A.int x=3;fun(x);
B.const int y=3;fun(y);
C.fun(3);
D.以上三种都正确
第3题
A.正确
B.错误
第4题
A.int(*p)(int,int)
B.int*p(int,int)
C.int*p[int,int]
D.以上选项都不对
第5题
执行语句“string str("abc");”时,系统会自动调用string类的构造函数()。
A. string()
B. string(const char *s)
C. string(const string &str)
D. string(size_type n, char c)
第6题
A.1个
B.2个
C.3个
D.4个
第7题
A.在程序中使用内联函数使程序的可读性变差
B.在定义函数时可以在形参表的任何位置给出缺省形参值
C.使用#define可以为常量定义一个名字,该名字在程序中可以再赋另外的值
D.使用const定义的常量名有类型之分,其值在程序运行时是不可改变的
第8题
A、错误
B、正确
第10题
A.istream& operator>>(istream&,自定义类型&)
B.istream& operator>(ostream&,自定义类型&)
C.ostream& operator<<(istream&,自定义类型&)
D.ostream& operator<<(ostream&,自定义类型&)
第11题
A.虚函数是静态的
B.虚函数声明只能出现在类定义的函数原型声明中
C.一个虚函数无论被公有继承多少次,它仍然保持其虚函数的特性
D.定义了虚函数后,程序中声明的指向基类的指针就可以指向其派生类