I am a novice programmer and just started to learn it. And yet I havnt finished all parts of programming. What I am going to do is just to write my own template vector class which then works for push, start, end, size, etc like simple functions..I have written the implementation of this function but the program is not running well. The main problem was with this destructor. Let me know if you can provide me the simple implementations.... Thanks
Just take your header file and get rid of the destructor. Here is what I came up with based on your code snippet and your post 3 posts back.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
template <typename T>
class vector
{
public:
vector() : size(0) {} // initialize the size in the constructor
void push(const T& value);
/* Other member functions here */
private:
T list[100];
int size;
};