• Advertisement
Sign in to follow this  

Structure within a structure

This topic is 4522 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys, i need some really quick help, im supposed to be implementing a tree data type, anyhoo, i have prob so i have
struct catergory_element
{
 char catergory_title[20]
 catergory *next_cat
 
 struct element
 {
 char element_name[20]
 element *next
 }; 
 
};
ok so im trying to create a catergory, with N amount of elements so eg: +MOVIES -terminator -titanic -matirx etc. OK, problem is i cant exactly reach the members of the struct element, what i mean by this is, in a certain funtion i have catergory *start_c = NULL; element *start_e = NULL; catergory works, however element part doesnt, i even tried catergory.element *start_e = NULL, nothing works!!! how could i reach the struct in the struct?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
catagory_element::element *start_e = NULL;

Share this post


Link to post
Share on other sites
Use the scope resolution operator to access the nested class.

class::nested_class var;

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement