How to correctly deallocate or delete a c++ vector?

前端 未结 6 1534
灰色年华
灰色年华 2021-01-25 11:00

I have a weird problem with vector in C++..

I created a vector and inserted 10000 integer values into it and have checked the memory utilization. It is 600 kb. But after

6条回答
  •  被撕碎了的回忆
    2021-01-25 11:44

    Try deleting each element and then deleting the vector itself - see if that makes any difference. Have you tried using valgrind to find out if there are any memory leaks?

提交回复
热议问题