【名词&注释】
关键字、初始化(initialization)、自定义(user-defined)、命令行(command line)、相关内容(related contents)、不合法、头文件、C源程序(c source program)、不能实现(cannot realize)、放在首位(in the first place)
[单选题]下面各选项中,均是C语言中合法标识符的选项组是
A. for china to
B. long_123 short 56_do
C. void union _342
D. text _023 _3ew
以下程序的执行结果是 ______。 #includeiostream.h> class Sample { int x; public: Sample(){}; Sample(int a){x=a;} Sample(Sample &a){x=a.x+1;} void disp(){cout"x="xend1;} } void main() { Sample s1(2),s2(s1); s2.disp(); }
有如下程序: #include iostream> using namespace std; class Base { public: Base(){ cout"BB";f(); } void f() { cout"Bf";} }; class Derived:public Base { public: Derived() { cout"DD"; } void f(){ cout"Df"; } }; int main(){ Derived d; return 0;}执行上面的程序将输出______ 。