【发布时间】:2012-02-16 17:26:26
【问题描述】:
编译此 c++ 代码时出现以下错误。这可能是什么原因?
# include <iostream>
# include <stdio.h>
# include <conio.h>
using namespace std;
class Foo
{
int a;
public :
virtual void Fun1();
Foo()
{a=5;}
};
Class X: public Foo // Error class does not name a type
{
Foo f;
public:
void Fun1() { }
X()
{
memset(&f,0x0,sizeof(f));
}
};
int main()
{
X x; // Error 'X undeclared and expected ; before x, i guess because of first one
getch();
return 0;
}
【问题讨论】:
标签: c++