Howdy. For my CSC 265 course, I'm making a list program. The rules are as follows: The program has a List class, which has a dynamic array (starts at size 2). The user can enter a value, print the values, or test the copy constructor (I'll come back to this).
Once they've entered two values, when they try to enter a third, the array needs to automatically add two to the size.
Printing the values is extremely simple, so I'm having no issues with this.
To test the copy constructor, it needs to run the copy constructor, set all of the values of the array to zero, and then print the zeroes.
After all of this works, I need to derive a Set class from List, and allow the user to choose which class to use at runtime.
Here are my problems:
1. When my array gets past size 2, it screws up my first entry. At size 4, it sets the first entry to 0, no matter what, and at size 6, it sets it to a huge number.
2. When I test the copy constructor, it doesn't seem to erase the numbers. It just outputs them.
3. I can't figure out how to get the user to choose classes. I tried an if statement, keeping the object name the same regardless of which class they used, but the compiler told me the object was undefined.
Here's a link to my code. Thanks so much for the help!
http://min.us/mlistprogram