单选题有以下程序
#include<iostream.h>
void ss(char*s,char t)
{ while(*s)
{ if(*S==t)*s=t-''a''+''A'';
s++;} }
void main( )
{ char strl[100]="abcddfefdbd",c=''d'':
ss(strl,c) ;cout<<strl;}
程序运行后的输出结果是( )。
单选题下列表达式的值为false的是{{U}} {{/U}}。
A. 1<3&&5<7
B. !(2>4)
C. 3&0&&l
D. !(5<8)||(2<8)
单选题下列对模板的声明,正确的是( )。
单选题下列选项中,不属于模块间耦合的是( )。 A) 数据耦合 B) 同构耦合 C) 异构耦合 D) 公用耦合
单选题有如下程序: #include<iostream> using namespace std; class Pair{ int m,n; public: Pair(int j,int k):m(j),n(k){} int get0{return m;} int getoconst{return m+n;} }; int main(){ Pair a(3,5); const Pair b(3,5); cout<<a.get()<<b.get(); return 0; } 运行时的输出结果是( )。
单选题若有以下程序: #include <iostream> using namespace std; void sub(int x,int y,int *z) *z=y+x; int main() int a,b,c; sub(8,4, sub(6,a, sub(a,b, cout<<a<<","<<b<<","<<c<<endl; return 0; 程序运行后的输出结果是( )。 A.12,18,30 B.-12,6,8 C.6,8,10 D.12,-18,16
单选题有下列程序:
#include<iostream>
using namespace std;
int main()
{
void function(double val);
double val;
function(val);
cout<<val;
return 0;
}
void fimction(double val)
{
val=3;
}
编译运行这个程序将出现的情况是
____
。
单选题有如下函数模板定义: template<typename T1,int a2,int a3> T1 sum(T1 a1) return(a1+a2+a3); 则以下调用中正确的是
单选题下列字符串中,不可以用做C++标识符的是( )。 A) y_2006 B) _TEST_H C) Retur_n D) switch
单选题有如下程序: #include <iostream> using namespace std; class A public: A(int i)X=i; void dispa( )cout<<x<<','; private: int x; ; class B:public A public: B(int i):A(i+10)x=i; void dispb( )dispa( );cout<<x<<endl; private: int x; ; int main( ) B b(2); b.dispb( ); return 0; 程序的输出结果是 A) 10,2 B) 12,10 C) 12,2 D) 2,2
单选题以下程序试图把键盘终端输入的字符输出到名为abc.txt的文件中,直到从终端读入字符“#”时结束输入和输出操作,但程序有错。程序出错的原因是______。
#include<iostream> #include<fstream>
using namespace std; int main(){
ofstream ofile; char ch;
ofile.open("d://abc.txt",'W');
do{ cin>>ch:
ofile.put(ch);
}while(ch!='#'); ofile.close();
return 0: }
A. 成员函数open()调用形式错误
B. 输入文件没有关闭
C. 成员函数put()调用形式错误
D. 对象ofile定义错误
单选题下列关于赋值运算符“=”重载的叙述中,正确的是______。
单选题对于循环队列,下列叙述中正确的是( )。
单选题有如下程序: #include<iostream> using namespace std; class TestClass public: TestClass()cout<<"default constructor/n"; TestClass(const TestClass ; TestClass userCode(TestClass b)TestClass c(b);return c; int main() TestClass a,d; cout<<"calling userCode()/a"; d=userCode(a); return 0; 在执行过程中,构造函数TestClass()和TestClass(const TestClass &x)被调用的次数分别是( )。 A) 1和1 B) 1和2 C) 2和3 D) 2和4
单选题每个C++程序中都必须有且仅有一个( )。
单选题下列控制格式输入输出的操作符中,能够设置浮点数精度的是
____
。
单选题下列运算符中全都可以被友元函数重载的是( )。 A.=,+,-, / B.[],+,(),new C.->,+,*,>> D.<<,>>,+,*
单选题下面对对象概念描述正确的是( )。 A.任何对象都必须有继承性 B.对象是属性和方法的封装体 C.对象间的通信靠文本传递 D.操作是对象的静态属性
单选题下列数据结果中,能够按照“先进后出”原则存取数据的是______。
单选题下面程序的运行结果是{{U}} {{/U}}。
#include<iostream.h> int x=5; int fun(int
a) { int c;
C=X*a; retum c; } void
main() { int x=3,a=4;
x=x+fun(a); cout<<"x"”<<X<<endl;
}
A.x=15
B.x=17
C.x=23
D.x=25
