Hey everyone, I've been having some trouble in C, i'm using a variety of array nested structs in order to model a universe. Here is the struct code...
struct star
{
int x;
int y;
int z;
int m;
char name[100];
};
struct colony
{
int pop;
};
struct planet
{
int x;
int y;
int z;
int m;
int colonized;
char name[100];
struct colony colony_member;
};
struct galaxy
{
int x;
int y;
int z;
char name[100];
struct planet planet_member;
struct star star_member;
};
Let's say I made 10 random galaxies with random values in the struct, how would I create 100 planets within that galaxy struct? I'm confused as how the best way to handle this would be, or even if structs if the way I want to go.
Thanks in advance!
-Devan