Hi :)
How do you write a program that reads a text file (music.txt) & stores it in a Data Structure.
I hope that I explained this well but here is a little more info incase not
Write a program that reads the data from the
music.txt file and store it in a data structure. To implement this data structure you must use an array of songs and each song must be represented by a struct with appropriate fields.
So far all I have is this(very simple I know) but so far is it correct?
Any advice on how to do this would be extremely helpful :)
#include <iostream>
#include <fstream>
#include <strstream>
using namespace std;
int main()
{
ifstream fin("music.txt");
if (fin.fail()) {
cout << "Can't open file!\n";
}