I'm trying to create an structure with other structures inside.
struct bullet{
char bullet_sprite[100];
int pos_x;
int pos_y;
int ace_x;
int tag;
};
struct bullets_onscreen{
struct bullet v[2];
struct bullet a[2];
};
I get this error:
error: array type has incomplete element type
Is this posible to do?
Example code:
//Calling functions
struct bullets_onscreen[2] //public
struct bullet bala[1];
init_bullet(&bala,_player);
set_bullet_on_screen(&bala);
void set_bullet_on_screen(struct bullet *_bullet){
array_bullet[1] = _bullet;
}
void init_bullet(struct bullet *_bullet, struct player *_player){
//inits all bullet components
}
bullets_onscreenas array of 4bullet?struct bullet bullets_onscreen[4];struct bullets_onscreen[2] //public-->struct bullets_onscreen[2]; //public