All pastes #491165 Raw Edit

Something

public c v1 · immutable
·published 2007-05-16 13:57 UTC
rendered paste body
void userWriteToFile(){  char name[SET];  char artist[SET];  char composer[SET];  char album[SET];  char genre[SET];  char size[SET];  char time[SET];  char trackNumber[SET];  char trackCount[SET];  char year[SET];  char playCount[SET];  char fileName[SET];  char yes = 'y';  FILE * write;  printf("What file would you like to write to? ");  scanf("%s", fileName);  write = fopen(fileName, "a");  while(yes != 'n'){        printf("Please enter the song name : ");    gets(name);    printf("Please enter the artist : ");    gets(artist);        printf("Please enter the composer : ");    gets(composer);        printf("Please enter the album : ");    gets(album);        printf("Please enter the genre : ");    gets(genre);      printf("Please enter the file size in bytes : ");    gets(size);        printf("Please enter the song length in seconds : ");    gets(time);    printf("Please enter the track number : ");    gets(trackNumber);        printf("Please enter the number of tracks total : ");    gets(trackCount);        printf("Please enter the year : ");    gets(year);        printf("Please enter the play count : ");    gets(playCount);      fprintf(write, "%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n",            name,            artist,            composer,            album,            genre,            size,            time,            trackNumber,            trackCount,            year,            playCount);        printf("Would you like to add another line? (y/n) ");    scanf("%c", &yes);}  fclose(write);  return;}