I currently have no code, because I don't know how to do this at all. Could I just, by myself, calculate how many bytes is needed for each lower-level struct and malloc it to it? That's really terrible coding, isn't it. Here's the two structs I'm trying to mash together:
struct property {
int d;
char name [111]; // I just malloc this like I would a normal array, right?
char descr [1025]; // Ditto.
}
struct category {
int d [413]; // The d's of all the child structs sorted highest to lowest.
char name [111];
struct property property [413]; // This. How do I allocate this?
}</code>
Do I have to do struct property* property = (struct property*) malloc(sizeof(struct property) * 413);
? Will the malloc of the array within remain intact? How do mallocs in structs behave in general?