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

  #include "Stdafx.h" # included "guardian" guardian: guardian () {} parent: ~ generator () {}   

Child.h

  #pragma Once #include "Parents.h" Classroom Children: Parents {public: hair (); ~ hair ();}       ) {} Child: ~ Child () {}   

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

  #pragma once #include & lt; Vector & gt; Using Std :: vector; Class child; Classroom Parents {Public: Generator (); Generator (); The vector & lt; Hair * & gt; children; };    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -