D
DaveJ
Hi,
This is quite a simple question (hopefully).
If I create a vector (on any container) on the heap e.g.
std::vector<std::string> * m_VectorOfStrings = new
vector<std::string>;
I know that the vector itself will be placed on the heap, but if I
just add strings to it such as:
m_VectorOfStrings.push_back("mystring1");
Will the string also be stored on the heap? Or do I need to create a
string with the new operator as well?
I assummed that any data stored inside a container on the heap would
also be stored on the heap, but just wanted to clarify this.
Thanks
This is quite a simple question (hopefully).
If I create a vector (on any container) on the heap e.g.
std::vector<std::string> * m_VectorOfStrings = new
vector<std::string>;
I know that the vector itself will be placed on the heap, but if I
just add strings to it such as:
m_VectorOfStrings.push_back("mystring1");
Will the string also be stored on the heap? Or do I need to create a
string with the new operator as well?
I assummed that any data stored inside a container on the heap would
also be stored on the heap, but just wanted to clarify this.
Thanks