Notices
Results 1 to 4 of 4

Thread: I have a Cyclical #include problems. Can someone kindly help me solve it please!

  1. #1 I have a Cyclical #include problems. Can someone kindly help me solve it please! 
    Forum Ph.D.
    Join Date
    Jan 2013
    Posts
    911
    Yo guys, I've got a cyclical # include problem,


    1) CProjectileManager needs to include "Map.h" to access a data member "vector<CTile*> theScreenMap" in CMap to check for projectile collision.


    2) "theScreenMap" is a vector<CTile*>, so i need to include "Tile.h" to access CTile class.


    3) CTile has a function "void spawnProjectile(CProjectileManager &theManager);" for the tile to spawn projectiles, and needs to include "ProjectileManager.h" to access CProjectileManager.


    Notice "ProjectileManager.h" calls "Map.h" which calls "Tile.h" which cyclically calls "ProjectileManager,h" again.

    Anyone got any solutions?


    Quote Originally Posted by jocular View Post
    If thy right nipple offend thee, pluck it off! Goes for the other, too!
     

  2.  
     

  3. #2  
    Forum Ph.D.
    Join Date
    Jan 2013
    Posts
    911
    Okay guys i've asked a senior and he helped me solve it a minute ago I had to use class prototyping.

    I've been taught that functions can be prototyped, but i didn't know that classes can be prototyped.

    This thread can be closed!!

    If no one wants to add something hahah.


    Quote Originally Posted by jocular View Post
    If thy right nipple offend thee, pluck it off! Goes for the other, too!
     

  4. #3  
    Forum Ph.D.
    Join Date
    Jan 2013
    Posts
    911
    Why can't i close my own thread? ._."

    are we even allowed to do that

    ( or delete it without going through moderators? )
    Quote Originally Posted by jocular View Post
    If thy right nipple offend thee, pluck it off! Goes for the other, too!
     

  5. #4  
    WYSIWYG Moderator marnixR's Avatar
    Join Date
    Apr 2007
    Location
    Cardiff, Wales
    Posts
    5,760
    usually it's not that important that a thread be closed, you never know who might want to add a snippet here or there, even if YOU think it's completed
    still, if it means that much to you, i'll close the thread for you ... (but i'll re-open it if someone complains)
    "Reality is that which, when you stop believing in it, doesn't go away." (Philip K. Dick)
     

Similar Threads

  1. What Problems to Solve – By Richard Feynman
    By river_rat in forum General Discussion
    Replies: 2
    Last Post: July 15th, 2014, 07:44 AM
  2. Can getting fuels from space solve our energy problems?
    By mmatt9876 in forum Personal Theories & Alternative Ideas
    Replies: 16
    Last Post: September 22nd, 2013, 09:41 AM
  3. How does war solve problems?
    By NNet in forum Politics
    Replies: 39
    Last Post: September 6th, 2013, 01:25 AM
  4. What problems does organic agriculture solve?
    By Winfried in forum Environmental Issues
    Replies: 312
    Last Post: September 5th, 2012, 07:15 AM
  5. Using Quantum Computers to Solve NP problems
    By guymillion in forum Mathematics
    Replies: 1
    Last Post: July 26th, 2012, 10:34 AM
Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •