Hello!
Well I need (for a homework) to implement a class vector from a class list.
im using VC6++.
The class list is here:
http://www.di-mare.com/pub/Pg2/ADH_list.zip
We have to use that exact list.
and the declaration of the class vector is:
class vector {
public:
vector(size_t n); // Contructor
vector(); // Contructor by default
~vector();
void Add_End (size_t); // add elements to the end
void Add_Beg (size_t); // add elements to the beginning
void Del_End (size_t); // Delete elemnts from the end
void Del_Beg (size_t); // Delete elements from the beginning
T & operator[] (size_t); // V[j]
size_t Capacity() const;
size_t Dimension() const;
}; // vector
now, don't get me wrong, I don't pretend one of you making all the work and I get a good grade. I really need to learn how to do this.
By implementing I think he means that we must be able to declare vectors like this:
vector MyVector;
vector TheVector(5);
MyVector.Add_End(1);
TheVector.Add_Beg(3);
correct me if Im wrong but the list makes it possible for the vector to hold any of the basic types right?
I must write each method for the class vector (Add_Beg, Add_End etc...) but I dont have a clue of how to do it. I dont really understand how to do it and neither how to make the vector class instantiable...
by the way, we are using a typedef so wherever you see
size_t it means
int
I must beg for your assistance, im lost here...
Thanks anyway