c++ - Instance of Forward declared Class -
This is a follow-up question:. If the child has been forwarded to the parent's head.
Is not included in this, so the child will not get the complaint? Then how can I install a new hair object from the original object.
Parent.h } Zero Parents: GiveBirth () {Child F = hair (); // error: incomplete type is not allowed) Parents :: Generator () {} Child.h Here are some readable lists for you. Parent.cpp
#pragma #include & lt; Vector & gt; Using Std :: vector; Class child; Classroom Parents {Public: Generator (); Zero GiveBirth (); Generator (); The vector & lt; Hair * & gt; children; }; Parent.cpp
#pragma #include "Parent.h" class Once Upon a Child: Parent {Public: Child (); ~ Hair (); }; ) {} hair: ~ hair () {}
#include "stdafx.h" #include "parent.h" #include "Child.h" Parents :: Guardian () () void parent: GiveBirth () {// Child CH = hair; // Error: Incomplete children are not allowed Push_back (new kid ()); } Parents :: Generator () {}
Comments
Post a Comment