# Recursive Include in C++???



## AdamTurner (Sep 22, 2003)

I am working on a Building simulation project.
The building is made of Elevators and Floors, both of which are made of People.
In order for me to load people onto elevators, the floors receive an elevator pointer and try to load each of its people onto the elevator. This works fine.

I assumed that the exact opposite would have to work in order to move people from elevators to floors i.e. the elevator would receive a floor pointer and then try to unload each of its people onto the floor. Now that I have set up my functions when I try to include 'floor.h' into the elevator class and then try to include 'elevator.h' inside the floor class its a recursive include and generates an error.

Does anyone know how to get around this??


----------



## AdamTurner (Sep 22, 2003)

Nevermind guys, Ive just found out what a forward declaration is!!


----------



## RedAxl (Nov 17, 2004)

:up:


----------

