单项选择题

有如下程序:
#include <iostream.h>
#include <iomanip.h>
using namespace std;
class CSum
int x,y;
public:
CSum (int x0,int y0):x(x0),y(y0)
friend ostream & operator<<(ostream& os,const CSum& x

A.

&nbs
<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序 #include <iostream> #include <string> using namespace std; class base private: char baseName[10]; public: base () strcpy(baseName, Base ); virtual char *myName() return baseName; char *className() return baseName; ; class Derived : public base private: char derivedName[10]; public: Derived() strcpy(derivedName, Derived ); char *myName() return derivedName; char *className() return derivedName; ; void showPtr(base &p) cout<<p.myName () << <<p.className (); int main () base bb; Derived dd; showPtr(dd); return 0; 运行后的输出结果为
A.Derived Base
B.Base Base
C.Derived Derived
D.Base Derived
单项选择题
有如下程序: #include <iostream.h> using namespace std; class Base public: Base() cout<< BB ; f(); voidf()cout << Bf ; ; class Derived: public Base public: Derived ()cout<< DD ; void f()cout<< Df ; ; int main()Derived d; return 0; 执行上面的程序将输出
A.BBBfDD
B.BBDfDDDf
C.DD
D.DDBBBf
相关试题
  • 以下程序的输出结果是 #include <iostr...
  • 有如下的程序: #include <cstring.h...
  • 有如下程序: #include <iostream> v...
  • 有以下程序: #include <iostream> u...
  • 下列类的定义中,有( )处语法错误。 cl...