Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The advantage of using union.

Status
Not open for further replies.

Taxidriver

Programmer
Jan 15, 2002
79
IT
Hello,
I have a binary search tree whose nodes should be of 3 different types: one node should store information for a point, the second for a segment (2 points) and the third for an area (2 points, 2 segments and other information). I use a struct that can be used for all 3 (there's a flag that identifies what the node contains) but I think that I waste a lot of space. Is there a way to save space? Could the "union" be of some use or, in my situation, is of not much convenience?
Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top