std::vector<Cstring> m_str;
std::map<int,CString> m_mapType;
std::map<int,std::vector<FileInfo>* > m_mapWa;
这样的变量初始化之后, 我怎么调试查看到每个元素的具体内容。有什么方式吗?
有具体的步骤,或是可以附上链接。
IDE 是VC6, 一些复杂的STL 调试的时候显示原始结构。都不知道怎么看,我在想有没有简单的办法可以查看,不然程序运行的时候就要用 printf 的方式了,有些麻烦。
变量是单列类中的复杂数据。 有好的方法吗? 如果用VS2013的话倒是很方便,支持复杂类型的查看。
VC6... As an aside, new VS users can write their own natvis files to describe how the IDE displays objects
Use an iterator, if you want to access the content in m_mapType:
std::map<int,CString>::iterator it=m_mapType.begin();
while(it!=m_mapType.end ()){
}
When tracing or pausing execution during debugging, just point to that variable directly. That prompt bar can be expanded, layer by layer.
Looking at your code, you may still be using an old editor such as VC6
This type of old compiler does not support some complex stl containers, such as map
If you know the key, you can Use map[key] in watch to view the map values one by one
After VS, the IDE can see the values of these complex data structures,