Untitled
Anonymous
C++
03/27/2022 5:58 PM
361 B
18
Indexable
Never
MyVector::MyVector(char *el, int maxsz) : maxsize(maxsz), size(0) {
pdata = new char *[maxsize];
if (el != NULL) {
size++;
}
pdata[0] = el;
for (int i = 1; i < maxsize; ++i) {
pdata[i] = NULL;
}
}
MyVector::MyVector(const MyVector &v) : pdata(NULL) {
*this = v;
}
MyVector::~MyVector() {
delete[] pdata;
}
Editor is loading...