单项选择题

有如下类定义: class AA{ int a; public: int getRef( )eonst{return &a;} //① int getValue( )const{return a;} //② vold set(int n)eonst{a=n;} //③ friend void show(AA aA) eonst{tout<<a;} //④ }; 其中的4个函数定义中正确的是

A.①
B.②
C.③
D.④
<上一题 目录 下一题>
热门 试题

单项选择题
有如下程序: #include <iostream> using namespace std; int main( ){ int*P; *P=9; cout<< The value at P: <<*P: return 0; } 编译运行程序将出现的情况是
A.编译时出现语法错误,不能生成可执行文件
B.运行时一定输出:The value at P:9
C.运行时一定输出:The value at P:*9
D.运行时有可能出错
单项选择题
语句ofstream f( SALARY.DAT ,ios_base::app)的功能是建立流对象f,并试图打开文件SALARY.DAT与f关联,而且
A.若文件存在,则将其置为空文件;若文件不存在,则打开失败
B.若文件存在,则将文件指针定位于文件尾;若文件不存在,则建立一个新文件
C.若文件存在,则将文件指针定位于文件首;若文件不存在,则打开失败
D.若文件存在,则打开失败;若文件不存在,则建立一个新文件
相关试题
  • 有如下程序: #include <iostream> u...
  • 若以非成员函数形式,为类Bounce重载“!”...
  • 已知一个函数模板定义为 template <type...
  • 下面是复数类complex的定义,其中重载的运...
  • 有如下程序: #include <iostream> u...