struct str_borders
{
int br;
};
struct str_country
{
int owner; // Redni broj zemlje
int armies; // Koliko ima vojske na teritoriji
char name[20]; // Kako se zemlja zove
char audio[30]; // Audio fajl za tu zemlju
str_borders granica[7]; // Sa kim se teritorijama ova zemlja granici, 7 je maksimum
};
struct str_country country[3]=
{
{0, 0, "Blank Space", "nosound.wav",{1,22,53,43,54,66,77}},
{0, 0, "Alaska", "sound/alaska.wav", {1,2,3,4,5,64,7}},
{0, 0, "NorthWest Territory", "sound/northwest.wav", {1,2,3,4,5,6,7}}
}; <================================================== LINIJA 35
Citanje strukture sa printf("Rezultat je %d\n", country[1].granica[4]);
Radi, uz jos jedan warning, al daje tacan rezultat.
Ako koristim
int gr=0;
gr=country[1].granica[4];
Dobijam gresku u kompajliranju:
error: cannot convert 'str_borders' to 'int' in assigment.
Gde gresim?
May the force be with you