@ Jlib, I did not. Thank you! I will read it now. (Edit: on that link it only lists 2 parameters btw)
@ Anon, you are correct, please see my last PM. I did incorporate most of that code for parsing, (even managed to change most of it as you have done with the strings). I especially focused on the delimiter parse segments (I think there were two?).
I even managed to get it to compile but the issue remained. By the time I had "debugged" (that's using that term correctly?), however, I had literally destroyed your code and so I posted in the open thread as suggested in your original PM to bring more people in and take the burden off you.
It's my first time posting and even though it shows the "code" and "output" windows, they weren't displaying in the "preview" (preview was completely empty) so I went back and used the cleanest/working source code I had. You are correct that you did provide parse code, and I did test it rigorously, I promise you, but if I addressed one line, 5 more errors from my compiler would pop up. By the time I was done, I had only about 9 lines left of your original code.
For instance, I also had done the manual changes to lines 36-44 too (part of the changes I made) but wasn't sure if I had done it right (followed your examples).
Another issue was line 33 and 49 keep giving me issues with the DVD:: part. My IDE was saying they were redundant.
Also "void parse_line (const string & line);" was throwing errors, but I managed to correct them (I forget how now) and it compiled.
As I mentioned in the PM, I had a hard time understanding alot of it but spent a few hours reading up line by line. If you recall, I had mentioned that I didn't know how/where to slot all the code in exactly (or more accurately, what replaced what, or if it all compounded together). I was simply of out my depth and didn't want to keep harassing you in PMs to "explain more".
For example, if I take this code above wholesale that you've just provided, I get the error "undefined reference to WinMain@16" which I have no clue what it means since that isn't declared anywhere in your code, so my IDE is making stuff up.
EDIT 2: Oh geez, I'm an idiot, I need to add my main() function under it.
EDIT 3: It says I'm missing my print declaration, so I assume I add that back in, however when I include:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
// Print one DVD
void Print (ostream & os) const
{ os << "Title: " << dvdTitle << endl;
os << "Year: " << dvdYear << endl;
os << "Genre: " << dvdGenre << endl;
os << "Runtime: " << dvdRuntime << endl;
os << "Rating: " << dvdRating << endl;
os << "Rental Price: " << rentalPrice << endl;
os << "Copies Owned: " << dvdOwned << endl;
os << "Copies Rented: " << dvdRented << endl;
os << "Copies Available: " << dvdAvail << endl;
}
|
I get told that none of those "dvdXXXX" are declared in the scope. I even tried adding a "void Print (ostream & os) const;" line to the member functions of the class too.
I promise you I spent ~7 hours working with your input plus a couple more this morning after chatting. Perhaps I should have done this step by step so that you can walk along with me through the errors, instead of me butchering it all and going backwards. I apologize and realize it must appear frustrating.
Also for the for loop, that part I did understand, but the instances are limited 10 dvds permanently, they are simply used to demonstrate that my class characteristics are created right. Don't worry, I took the while loop idea into memory and "learned" that for next time since it seems like a smart idea to "practice" for practical applications but is not needed this time.
And finally, you are correct about the operation for dvdAvail. It's so simple and obvious but I never even thought of it.