Skip to main content
gamedev.net
🔒 Locked

struct* contains struct*

Started by crebix 3 replies 300+ views
Original Post
crebix
crebix
How do I make two structures contain pointers to one another? In other words: How would I tell the compiler that a structure exists, but will be defined later on? Thanks!!
Carrot
Carrot
Just off the top of my head...



struct First
{
// Forward declaration
struct Second* m_mySecond;

};

struct Second
{
First* m_myFirst;

}

Pipo DeClown
Pipo DeClown
[edit] yeah thats how it works

.lick

[edited by - pipo declown on August 7, 2002 10:25:29 AM]
crebix
crebix
Thanks Carrot...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.