I have two classes which depend on each other I have solved this problem before but for my life It can not understand how to fix it. My simplified code is:
struct menu option {string text; Int Choice; Use the Bull submenu; Menu submenu; }; Class Menu {Public: Menu (menu option options list [], int optionscout); };
- Use further announcements
Ie:
// B announces further the announcement for the existence of B. Class B; Class A {// use BB * B; }; Class B {// uses A * a; };
- Use pointers and not object instances: Because the compiler needs to know how much space to allocate to members of the class. Being an example of an object, there is no work there because the compiler does not know its size without seeing the full declaration of its class. Indicators, however, are all the same size which is known for anything extra without compiler.
Comments
Post a Comment