7.24 作业

1.自己封装vector

template
class Myverctor
{
    T* first;
    T* last;
    T* end;
public:
    Myverctor():first(NULL),last(NULL),end(NULL){}
    Myverctor(int num,T data):first(new T[num])
    {
        last = end = first + num;
        for(int i = 0;i=last-first) throw 2;
            else return first[p];
        } catch (int e) {
            if(e==1)
                cout<<"vector为空"<

2.思维导图

7.24 作业_第1张图片

 

你可能感兴趣的:(c++)