Deleting a dynamic array of std::lists
Hi guys,
Small problem, this may be a stupid question - rough hangover , if I create a dynamic array where each element is a std::list as such:
std::list *pFreeList = new std::list[10];
How do I delete each std::list element of the array?
Thanks
Kyle
When deleting your array, just cycle through it and clear each list explicitly before deleting the array elements with delete [], should work.
-fel
-fel
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement