【发布时间】:2026-01-21 14:00:01
【问题描述】:
我的 std::map 看起来像这样。
std::map<int, std::string> *myMap = new std::map<int, std::string>[100];
如何删除这个? delete myMap够了吗?
【问题讨论】:
-
您能简单说明一下为什么您要解决的问题需要分配
std::map数组吗? -
std::vector<std::map<int, std::string>> myMaps(100);怎么样?那么你就不用担心删除它了。
标签: c++ arrays dictionary