单选题( )使一个函数可以定义成对许多不同数据类型完成同一个任务。
单选题已知Value是一个类,vMue是Value的一个对象。下列以非成员函数形式重载的运算符函数原型中,正确的是( )。
单选题决定C++语言中函数的返回值类型的是
单选题下列关于类定义的说法中,正确的是______。
单选题下列不属于软件工程过程的基本活动的是
____
。
单选题当输入“Thank you”时下列程序的输出结果为( )。 #include<iostream.h> #include<iomanip.h> void main() { char line[80]; cin.getline(line,sizeof(80),'k'); cout<<line; }
单选题有以下程序: class Date { public: Date(int y, int m, int d); year = y; month = m; day = d; Date(int y = 2000) year = y; month = 10; day = 1; Date(Date month = d.month; day = a.day; } void print() cout<<year<<"."<<month<<"."<<day<<end1; } private: int year, month,day; }; Date fun(Date d) Date temp; temp = d; return temp; } int main() { Date date 1 (2000,1,1),date2(0,0,0); Date date3(date 1); date2 = fun(date3); return 0; } 程序执行时,Date 类的拷贝构造函数被调用的次数是
单选题语句ofstream f("SALARY.DAT",ios∷app|ios∷binary);的功能是建立流对象f,试图打开文件SALARY.DAT并与之连接,并且 A)若文件存在,将文件写指针定位于文件尾;若文件不存在,建立一个新文件 B)若文件存在,将其置为空文件;若文件不存在,打开失败 C)若文件存在,将文件写指针定位于文件首;若文件不存在,建立一个新文件 D)若文件存在,打开失败;若文件不存在,建立一个新文件
单选题在C++中,打开一个文件时与该文件建立联系的是( )。
单选题有如下程序:
#include
using namespace std;
class A
{
public:
A(){cout<<“A”;}
};
class B{public:B(){cout<<“B”;}
};
class C:public A
{
B b:
public:CO{cout<<“C”;}
};
int main()
{
C obj;
return 0:
}
执行后的输出结果是( )。
单选题下列关于运算符重载的叙述中,正确的是______。
单选题有如下模板声明:
template<typename T1, typename T2>
class A;
下列声明中,与上述声明不等价的是______。
单选题在每个C++程序中必须有且仅有一个______。
单选题下面程序的输出结果为( )。 #include<iostream.h> void fun(int a,int b) int temp; temp=a; a=b; b=temp; void main() int m,n; re=1; n=2; fun(m,n); eout<<m<<""<<n<<end1; A) 12 B) 21 C) 22 D) 程序有错误
单选题有如下语句序列: int k=0: d0k+=5;cout<<'$';wbile(k<19); while(k-->0)cout<<'*'; 执行上面的语句后,序列输出字符$和*的个数分别是 A) 4和20 B) 5和20 C) 4和21 D) 5和21
单选题以下程序的输出结果是
#include<iostream.h>
void main()
{ int x=1,y=3;
cout << x++ << " , ";
{ int x=0;X+=y*2;
cout<<x<<" ,"<<y<<" ;";
}
cout<<x<<" ,"<<y;
}
单选题有以下程序: #include<iostream> using namespace std; int main() char a[10] = '1','2','3','4','5','6','7','8','9','0'),*p; int i=8; p=a+i; cout<<p-3<<end1; return 0; 执行程序后的输出结果是( )。
单选题下列关于函数重载的叙述中,错误的是______。
单选题假定其中的x的单位是角度且不考虑π的值的精度,则与数学公式等价的C++语言表达式是()。
单选题以下程序的输出结果是 #include<iostream.h> void main( ) inti,j,x=0; for(i=0;i < 2;i++) x++; for(j=0;j < 3;j++) if (j% 2)continue; x++; x++; cout < < "x=" < < x;A) x=4B) x=8C) x=6D) x=12
