How to display the values of a struct
I have yet another question!
How would you display the contents of struct?
Code:
typedef struct
{
char track[20];
char trackname[20];
char artist[20];
char genre[20];
} song;
E.G, in the code above, to printf the contents of trackname?
A lecture provided:
Code:
int x;
for(x=0; x<10; x++)
printf("%d", a[x]);
But I have little knowldege for adapting this. I tried changing the decimal into char and changing 'a[x]' into song, song.trackname and a few other variants, but have not been able to get it to work.