r/learncpp • u/Shogger • Mar 16 '17
Vectors containing dynamically allocated arrays.
So, say I have a vector<bool*>. A vector containing pointers to arrays of booleans. I use vector.push_back(new bool[n]) on it a few times. Eventually I'm done and the program closes.
Will the vector's destructor take care of those dynamically allocated arrays, or do I need to delete[] them myself?
0
Upvotes
View all comments
Show parent comment
1
u/Shogger Apr 22 '17
Thanks. I did eventually find the answer but I appreciate the response. It could help someone else down the line.