Skusil som toto:
#include <stdio.h>
#include <stdlib.h>
typedef struct weapon
{
int *weaponEquiped;
int wee;
};
typedef struct player_st
{
char name[9];
weapon *zbran;
};
int main()
{
player_st player;
player.zbran = (weapon *) malloc(sizeof(weapon));
player.zbran->weaponEquiped = new int;
player.zbran->weaponEquiped=5;
printf("%d", player.zbran->weaponEquiped);
system("pause");
return 0;
}
Bohuzial stale nefunguje.