// Struct II #include #include // let's define a macro #define MAXSIZE 256 // let's use a typedef so we don't have to // write struct all the time typedef struct Song_type Song; struct Song_type{ char artist[MAXSIZE]; char name[MAXSIZE]; int length; }; void printSong(Song song){ printf("%s, by the %s, length = %d seconds\n", song.name, song.artist, song.length); } int main(){ Song myMusic[10]; Song tmp; strcpy(tmp.artist, "psb"); strcpy(tmp.name, "I wouldn't normally do this kind of thing"); tmp.length = 183; for(int i=0; i<10; i+=1){ myMusic[i] = tmp; } printSong( myMusic[1] ); return 0; }