c++ - error C2504 circular inclusion -
I have parents and child classes inherited from child guardian I store child objects in a vector Want to
I include the hair headers in the parent headers, but I have to include the parent headers in the hair headers (because it handles
parents Include "Child.h" using the #pragma one time # & lt; vector & gt; # std :: vector; class parent {public: parent (); ~ & Lt; child & gt; Children;}; parent.cpp Child.h Errors child. H (4): error C2504: 'parent': base class undefined parent.h (11): error C2065: 'child': unknown identifier < Div class = "post-text" itemprop = "text"> Declare further, and store the pointer inside the vector. Parent.h
#include "Stdafx.h" # included "guardian" guardian: guardian () {} parent: ~ generator () {}
#pragma Once #include "Parents.h" Classroom Children: Parents {public: hair (); ~ hair ();} ) {} Child: ~ Child () {}
#pragma once #include & lt; Vector & gt; Using Std :: vector; Class child; Classroom Parents {Public: Generator (); Generator (); The vector & lt; Hair * & gt; children; };
Comments
Post a Comment