I have a question about converting from std::vector to an array.
I have a vector of pointers to object. How can I convert it to an array of pointer to objects in C++?
The vector is
std::vector<pin*> *_PINS
I want to convert it to
pin** pins_arr
I’ve tried everything that has been suggested in here but it doesn’t work
I guess the reason why it’s not working is because I have pointer to object as a type instead of basic type.
Would you please help me with this? I’ve been stucked for the whole morning.
Thank you,
Edit: if you really insist on doing a conversion like this, I suppose you could do something on this order:
I have to agree with Ed.S though — what you’re doing here defeats most of the purpose of using
std::vectorin the first place, and frankly strikes me as a bit silly.