I tried using (*game_data.blocks), (game_data.*blocks), (game_data.blocks) but none of them work.
I'm getting a error msg: 'cannot convert sprites* to sprite_data** in assignment'
-----------------------------------------------------------
typedef struct{
//sprite _sprites[];
sprite *blocks;
sprite ball;
sprite paddle;
int numb_brick_sprites;
}sprites;
----------populate_bricks procedure-------------
void populate_bricks(sprites &game_data){
game_data.numb_brick_sprites++;
sprites *temp_ = (sprites*) realloc(game_data.blocks, game_data.numb_brick_sprites * sizeof(sprites));
if(temp_ != NULL) {
game_data.blocks = temp_; //getting error msg here: cannot convert sprites* to sprite_data** in assignment
}
else {
printf("Error creating bricks...\n");
return;
}
}
-----------------main function------------
int main(){
sprites game_data;
game_data.blocks = NULL;
game_data.numb_brick_sprites = 0;
initialise_game(bitmap_names, game_data);
}
Thanks