如果密钥值在c++中,则如何在cmap中找到值。
我有一个需要存储密钥的要求,值对以MFC cmap
对。虽然将值存储在此映射中时,关键值之一中有一个空间,并且正确地将键和值对插入到cmap
中。
但是,当我试图找到具有空间的密钥的值(两个单词)时,该值不会由cmap
lookup命令返回。 (如果键没有空间,则可以正常工作)。
如果键在cmap
中,我可以知道如何查询该值。
关键在这里:“你好世界” 价值:“测试”;
CMap<LPCTSTR,CString> testMap;
if(testMap.LookUp((LPCTSTR)key.MakeLower(), val))
{
}
I have a requirement where I am storing the key, values pairs in a MFC CMap
. While storing the values in this map one of the key values has a space in it and properly the key and value pairs are inserted into the CMap
.
But when I am trying to find the value of a key which has space in it (two words), the value is not returned by the CMap
lookup command. (if key does not have space then its working fine).
May I know how to query for the value if the key has space in it in CMap
.
key here : "hello world"
value : "Test";
CMap<LPCTSTR,CString> testMap;
if(testMap.LookUp((LPCTSTR)key.MakeLower(), val))
{
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论