#include <iostream>
using namespace std;

#include "ArrayVector.h"

int main()
{
    int i;
    Vector<int> Vec(4);             //create a new vector of 4 integers
    for(i=0;i<Vec.Length();i++)
        Vec[i] = i*i;               //initalize each entry

    for(i=0;i<Vec.Length();i++)
        cout << Vec[i] << ' ';
    cout << endl;                   //display the current contents

    Vec.ReSize(3);                  //resize the vector to contain only 3 elements
    Vec.PushEnd(10);                //add 10 as the last element in the vector

    for(i=0;i<Vec.Length();i++)
        cout << Vec[i] << ' ';
    cout << endl;                   //display the current contents

    Vec.Allocate(2);                //reallocate space for 2 elements; the data will point to junk.
    for(i=0;i<Vec.Length();i++)
        cout << Vec[i] << ' ';
    cout << endl;                   //display the current contents
    Vec.FreeMemory();               //delete the vector.  This automatically happens then the vector leaves scope.
    cout << Vec.Length() << endl;   //the empty vector has zero length

    return 0;
}