Hi ive been trying to create a simple struct within another struct within anotherworks create can access all the data members fine. My problem is simply, How can i have a dynamic struct array from within a struct?
for example:
what i want to be able to do is use this structure to load data from a file. the no_of_planets and no_of_sats would be loaded from the file along with data for the other data members. the data could be different everytime the program loads or even be changed after its loaded.Code:struct Sats { enum sat_type{station, astroid, moon}; int height; // height it orbits from planet }; struct Planets { float radius; // radius of planet int days; // how many days does the planet have a year? int distance; // distance it orbits from star Sats sats[no_of_sats]; }; struct star_system { Planets planet[no_of_planets]; };
Regards,
Paul



LinkBack URL
About LinkBacks
works create can access all the data members fine. My problem is simply, How can i have a dynamic struct array from within a struct?


