单项选择题

有如下类定义: class Foo { public: Foo(int v):value(v){} //①    ~Foo(){} //② private:     Foo(){} //③     int value=0; //④ }; 其中存在语法错误的行是

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

单项选择题
若磁盘上已存在某个文本文件,其全路径文件名为d: ncre test.txt,下列语句中不能打开该文件的是
A.ifstream file("d:\ncre\testxt");
B.ifstream file("d:\\ncre\\testxt");
C.ifstream file;filopen("d:\\ncre\\testxt");
D.ifstream* pFile=new ifstream("d:\\ncre\\testxt");
单项选择题
有如下函数模板: template<typename T,typename U> T cast(Uu){ return u;} 其功能是将U类型数据转换为T类型数据。已知i为int型变量,下列对模板函数cast的调用中正确的是
A.cast(;
B.cast<>(;
C.cast<char*,int>(;
D.cast<double,int>(;
相关试题
  • 已知一个函数模板定义为template<typename...
  • 有如下程序:#include <iostream>using...
  • 下面是复数类complex的定义,其中重载的运...
  • 若以非成员函数形式,为类Bounce重载“!”...
  • 有如下程序:#include<iostream>using ...