Hi
I am new to stl.
I see that we don't need to delete our containers
For example:
vector <char> vec;
But why?
Here, Does vec allocate in heap or stack by default.I heard that Although we don't create vec without new , it is allocated in heap and automatically delete it.Is this true?
If true i tried this:
vector <char>* vec = new vector<char>;
delete vec;
it doesn't give me error.Here this mustn't work.Am i wrong?
I looked to google, there are so many things about stl but i can't find explanation about relationship between stl containers and heap,stack allocation(or new ,delete).In what circumstances are stl containers allocated in heap or stack.And In what circumstances do we need to delete our containers?
Can you please explain me.
Thanks...