**I have to created my scruct and function but i have to do this in my .cpp file HELP?
1. Open the file
2. Set up an empty CDS struct
3. Start going through the file until EOF (Loop 1)
4. Read in CD Artist, title, year, rating and numSongs
5. Check for resize, resize if necessary
6. createCD using Artist, title, year, rating and numSongs
7. Using number of songs, start (Loop 2)
8. Read song title and length
9. Add song to current CD
11. end loop 2
13. Increment current CD
14. End loop 1
15. Return CDS**
* CDS* createCDS (string filename)
{
ifstream inFile;
int numCDS;
inFile.open (filename.c_str("cds.txt"));
CDS** myCDS = new CDS* [numCDS];
while (!inFile.eof())
{
inFIle >> data;
int artist;
int title;
int songs;
cd->cdArtist = artist;
cd->cdTitle = title;
}
}
HugeTeddyMonser 0 Newbie Poster
AssertNull 1,094 Practically a Posting Shark
HugeTeddyMonser 0 Newbie Poster
AssertNull 1,094 Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.