POB_2019/zad7_3.cpp
2019-05-13 20:54:13 +02:00

27 lines
547 B
C++

#include <iostream>
using namespace std;
template <typename type>
class Array {
private:
type* basePtr;
Array(unsigned int n){
basePtr=(type*)malloc(sizeof(type)*n); //allocate the memory
}
~Array(){
free(basePtr);
}
public:
Array& operator new [](unsigned int n){
Array(n);
return *this;
}
void* operator delete [](unsigned int n){
~Array();
}
type operator[](){
return
}
};