I have a question about allocate Memory with: malloc(sizeof(STRUCT));
typedef struct
{
var koor_x_abs;
var koor_y_abs;
var koor_x;
var koor_y;
var bombenreichweite;
var erzeuger_id;
var kicker_id;
var speed;
PANEL* panel;
} BOMBE;
typedef struct
{
var koor_x_abs;
var koor_y_abs;
var koor_x;
var koor_y;
var start_koor_x;
var start_koor_y;
var anz_leben;
var unverwundbar;
var richtung;
var bombenanzahl;
var bombenanzahl_max;
var bombenreichweite;
var speed;
var speed_orginal;
var anz_schuhe;
var tod;
var id;
var ki;
var sp_status;
var negativ;
var r;
var l;
var u;
var o;
var t1;
var t2;
var joy1_aktiv;
var joy2_aktiv;
var t1_gedr;
var t2_gedr;
PANEL* panel;
BOMBE Bombe[Anz_bomben];
} PLAYER;
PLAYER Player[Anz_spieler];
You can see i want to use a array from the Struct (Anz_spieler = 8).
How do i use now malloc?
Player = malloc(sizeof(PLAYER)); --> is this right?