I have 2 class(A & C) defined in a file allocate.h and class B defined in work.h.
I included allocate.h inside work.h file
My code looks like :
Class A{
}
Class C
{
public:
struct xyz{
A ob;
};
}
include"allocate.h"
Class C;
Class B{
void test(){
xyz obj; // `Error : error c2036 : xyz unknown size`
}
}
Can someone tell me how can i communicate the size of xyz structure in function test?
classin C++ (which is case-sensitive) is all lower-case and the declarations end in semicolons. Please paste real code into your questions!In this instance,
xyzis declared within the scope ofclass C, so you’ll need to specify the scope when you use it.