I’ve got a class:
someclass header code:
class SomeClass{
SomeClass();
vector<int> somePointerVector;
public:
SomeClass(vector<int> &someVector);
};
Im a little confused about how to use vectors here. I’d like to set somePointerVector = someVector, so that I can manipulate the data in someVector with other parts of the class using somePointerVector and I also don’t want to copy all of someVectors data.
With an array I’d do it with:
int* somePointerArray = someArray;
But how would I do this with vectors?
Make
somePointerVectora reference and put it in the initialization list of your class. (And please give it a better name.)