Vector and element on the heap

Viewed 87

I am trying to understand the concept of heap and the stack, so I need to create a vector which its elements are stored in the heap. So far I have done the followings:

class Car {
public:
Car(){
    Car->resize(0);
    Size = 0;
}

 private:
std::vector<int>* CarVector = new std::vector<int>;
size_t Size;
};
0 Answers
Related