我从课本上抄的例题有错误,希望大虾们帮解决一下
#include <iostream>
using namespace std;
class B1
{
public :
B1(int i){cout<<" 构建B1:"<<i<<endl;
~B1(){cout<<" 析构B1:"<<endl;
};
class B2
{
public:
B2(int j ){cout<<"构建 B2:"<<j<<endl;
~B2(){cout <<"析构B2:"<<endl;
};
class B3
{public :
B3(){cout <<"构建 B3:*"<<endl;
~B3(){cout <<"析构 B3:"<<endl;
};
class C:public B2,public B1,public B3
{public :
C(int a,int b,int c,int d):B1(a),memberB2(d),memberB1(c),B2(b){}
private :
B1 memberB1;
B2 memberB2;
B3 memberB3;
};
void main ()
{C m1(1,2,3,4);
}
错误调试:
--------------------Configuration: 2 - Win32 Debug--------------------
Compiling...
2.cpp
D:\学习文件\例7-6\2.cpp(32) : fatal error C1075: end of file found before the left brace '{' at 'D:\学习文件\例7-6\2.cpp(17)' was matched
执行 cl.exe 时出错.
2.obj - 1 error(s), 0 warning(s)