填空题

非成员函数应声明为类的 【9】 函数才能访问这个类的private 成员。

【参考答案】

友元
<上一题 目录 下一题>
热门 试题

填空题
下列程序的输出结果为Object id=0Object id=1请将程序补充完整。#include <iostream>using namespace std;class Pointpublic: Point(int xx=0,int yy=0) X=xx; Y=yy; countP++; ~Point()countP--; int GetX()retum X; int GetY()return Y; static void GetC() cout<< Object id= <<countP<<end1;private: int X,Y; static int countP;; 【11】 静态数据成员的初始化int main() Point:: GetC(); Point A(4,5); A. GetC(); retum 0;
填空题
下面程序的运行结果为 【10】 。#include<iostream.h>void main()char a=’3’;switch(a)case’3’: cout<< 3 ;case’2’: cout<< 2 ; break;default: cout<< 1 ;
相关试题
  • 在析构函数中调用虚函数时,采用 【15】...
  • 下列程序的输出结果是 【13】 。#incl...
  • 分析以下程序的执行结果 【14】 。#in...
  • 以下程序执行后的输出结果是 【12】 。...