I got the following error wwhile compiling this c++ code . What can be the reason behind this ?
# 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;
}