问题 填空题

使用VC++6.0打开考生文件夹下的源程序文件1.cpp,该程序运行时有错,请改正其中的错误,使程序正常运行,输出的结果为
Constructor,i=0,
Destructor
注意:错误的语句在//******error******的下面,修改该语句即可。
试题程序:
#include<iostream.h>
class TC

int i;
public:
TC();
void display();
~TC();

//******error******
TC:TC()

cout<<"Constructor"<<",";
i=0;

//******error******
TC:display()

cout<<"i="<<i<<","<<end1;

//******error******
TC:TC()

cout<<"Destructor"<<end1;

void main()

TC a;
a.display();

答案

参考答案:应改为“TC::TC()”。

单项选择题
填空题