C++ map<string, CCSafeObject<CCDictionary*>> m_marchData 操作指南
C++ map> m_marchData 操作指南
本文介绍如何对 C++ 中的 map
添加元素
// 创建一个CCSafeObject对象
CCSafeObject newMarchData = new CCDictionary();
// 添加到m_marchData中
m_marchData["key"] = newMarchData; 替换元素
// 创建一个CCSafeObject对象
CCSafeObject newMarchData = new CCDictionary();
// 替换m_marchData中指定的元素
m_marchData["key"] = newMarchData; 删除元素
// 删除m_marchData中指定的元素
m_marchData.erase("key");
// 清空m_marchData中的所有元素
m_marchData.clear();> m_marchData 操作指南" title="C++ map原文地址: https://www.cveoy.top/t/topic/pVk8 著作权归作者所有。请勿转载和采集!