I have a code,
class foo : public bar
{
public:
foo(){};
~foo(){};
};
class wu
{
public:
wu(const bar& Bar ) :
m_bar(Bar)
{};
~wu(){};
private:
bar m_bar;
};
int main()
{
foo tmpFoo;
wu tmpWu(tmpFoo);
}
Now my problem is, the code above will not compile and the error message is "error: variable wu tmpWu has initializer but incomplete type".
Does it mean, I have to cast the tmpFoo object to bar class?
Please advice.
Thanks.
bar
being defined. – Georg Fritzsche Sep 15 '10 at 5:59bar
class is already defined) – Naveen Sep 15 '10 at 5:59bar
class. You have done that? – Naveen Sep 15 '10 at 6:02