#include<iostream> #include<malloc.h> using namespace std; template<typename T> class Vector{ private:T *p; int size; int n; public: Vector() {p=(T*)malloc(10*sizeof(T)); size=10; n=0;} void Push_back(const T a){ if(n==size){p=(T*)realloc(p,10*sizeof(T));size+=10;} *(p+n)=a; n++; } typedef T* Iterator; T* Begin() {return p;} T* End() {return p+n;} };