I'm writing a myVector class for a class I'm taking.  I don't believe I'm strong with smart pointers right now, so that's my question.  This is just an excerpt from a much larger class that I've completed.Is there a way to use the shared pointer and dynamically allocate the size, so that I can use the [] notation with that pointer?  I've been looking on Stack Overflow and don't see anything referencing this particular usage.  My next question/conclusion would then be that it's best to stick with raw pointers in the case where I want to use array notation.#include <iostream>//#include <memory>class myVector{private:    int sz;    int * array;public:    myVector(int a, int b)    {        sz = a;        array = new int[sz];        for(int i(0); i < sz; ++i)            array[i] = b;    }    ~myVector(){ delete [] array; };    int size() const    {        return sz;    }    int &operator[](const int num)    {        return array[num];    }};int main(){    myVector testing(10, 6);    for(int i(0); i < testing.size(); ++i)    {        testing[i] = testing[i] * i;        std::cout << testing[i] << std::endl;    }    return 0;}
Basic myVector class raw vs smart pointer
c++;pointers;vectors