Hi I'm trying to have a variable array of a structure in a different structure and then call a function that writes to one of the structures in the array. I think I have got the right idea but I have typed out some example code of how I am doing it to make sure.
This look good? ThanksCode:struct Sworld { world variables go in here... int board_count; struct Sboard *board; }; struct Sboard { board variables go in here... }; struct Sworld world; int main() { int i; world.board = malloc( sizeof(struct Sboard) * world.board_count); for (i = 0; i < world.board_count; i++) load_board(&world.board[i]); } void load_board(struct Sboard *board) { board->variable = somthing; }