you have to print each field individually
printf("name: %s\n", Doom3.name);
printf("memory: %d\n", Doom3.memory);
...
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
consider the following:
typedef struct
{
char name[20];
int memory;
int time;
int files;
} proceso; // proceso is a "type" of struct
// defined as having the above elements
proceso titulos[MAX_TITLES] = { // titulos is an instance of proceso
{"Doom3", 500, 4,5}, // declared as an array
{"Hades", 100, 2,1}, // and containing the following values
{"Word" , 50, 1,1},
{"FIFA" , 10, 3,1},
{"Doom2", 400, 5,2},
// ...
// question: how many is "MAX_TITLES" ?
};
//....
// print fields like so
for (i=0; i<MAX_TITLES; i++)
{
printf("title name: %s (%d MB)\n",titulos[i].name, titulos[i].memory);
}
// etc...
jephthah
Posting Maven
2,587 posts since Feb 2008
Reputation Points: 2,143
Solved Threads: 179