单项选择题

下面程序的输出结果为( )。
#include<iostream.h>
class CStaticpublic:
CStatic() val++;
static int val;
;
int CStatic::val=0;
void main()CStatic cs1;
cout<<cs1.val<< "";
CStatic cs2;
CStatic cs3, cs4;
cout<<cs2. val<<end1;

A.14
B.24
C.34
D.54
<上一题 目录 下一题>
热门 试题

单项选择题
有如下程序:#nclude <iostream>using namespace std;class Base public:void fun1() cout << Base n ; virtual void fun2() cout << Base n ; ;class Derived: public Base public:void fun1() cout << Derived n ; void fun2() cout << Derived n ; void f(Base& b) B. fun1(); B. fun2(); int main()Derived obj;f(obj);return 0;
A.Base
Base
B.Base
Derived
C.Derived
Base
D.Derived
Derived
单项选择题
模板函数的真正代码是在( )时候产生。
A.源程序中声明函数时
B.源程序中定义函数时
C.源程序中调用函数时
D.运行执行函数时
相关试题
  • 下列程序的输出结果是 【15】 。#incl...
  • 下面程序的输出结果是 【14】 。#defi...
  • 如果不使用多态机制,那么通过基类的指针虽...
  • 若以非成员函数形式,为类Bounce重载“!”...
  • 在C++语言中每个类都有一个 【11】 ...