As you can tell....I am a beginner.... Please help me get past this problem. I am not sure how to compare strings for equal signs.
I am at a brick wall. I have some unsorted albums with the name of the album, release date, CD Number and unsorted songs. I am reading in as a file. The albums are separated by equal signs.
I need to sort each set of songs and then sort the group of Albums. I have made a program to read in the file, but I am having trouble with figuring out how to make it read in the file up to the === signs and then read in the next group and so forth until it reaches the last group and reads them in.
This is the beginning of my code for reading them in:
#include <iostream>
#include <string>
using namespace std;
int main()
{
char line[255]; //read in line
int position;
string songTitle;
string songTitles[100];
int count = 0;
while(cin.getline(line,255))
{
songTitle = line;
songTitles[count++] = songTitle;
}
cout << "Song Titles: " << endl;
for(int i = 0; i < count - 1; i++) cout << songTitles[i] <<
endl;
return 0;
}