}
void printSong (const song_t *pSong)
{
int m = pSong ->duration/60,s = pSong->duration % 60;
printf("-----------------------------------\n"
"Title: %s\n"
"Artist: %s\n"
"Composer: %s\n"
"Playing time: %d:%02d\n"
"Date: %s\n",
pSong->title,pSong->artist,pSong->composer,m,s,dateAsString(pSong->published));
}
/*void dateAsString(struct Date d)
{
static char strDate[12];
sprintf(strDate,"%02d/%02d/%04d",d.month,d.day,d.year);
return strDate;
}*/
int main()
{
song_t kk = {"ppp","jl","ddf",33,{11,21,2014}};
printSong(&kk);
}
|