I thought that I did this the right way, but it turns out I can't allocate more than 1 size of an array. (I'm supposed to initialize a room_array data structure which is an array of structs).
I have this syntax.
This is the headerCode:int size_room = sizeof(struct room); room_t **room_structs = (room_t **)malloc(num_rooms * size_room);
this is a follow up from my last post, can anyone help me? I've been stuck since 7 pmCode:// a struct containing all the information which represents a room struct room { int room_id; char *description; mob_t mob; exit_t exits[NUM_DIRECTIONS]; puzzle_t puzzle; };![]()



LinkBack URL
About LinkBacks




