Advertisement
Guest User

Untitled

a guest
Jul 18th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void saveToFile(const char fileName[], const Song songList[], int size)
  2. {
  3.     ofstream    out;
  4.     out.open(fileName);
  5.     if (!out)
  6.     {
  7.         cerr << "Fail to open " << fileName << " for writing!" << endl;
  8.        exit(1);
  9.    }
  10.    for (int index = 0; index < size; index++)
  11.    {
  12.        out << songList[size].title << ';' << songList[size].artist << ';'<< songList[size].album << ';' << songList[size].min << ';' << songList[size].sec << '\n';
  13.    }
  14.    out.close();
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement