如果密钥值在c++中,则如何在cmap中找到值。

发布于 2025-02-12 09:36:41 字数 389 浏览 1 评论 0原文

我有一个需要存储密钥的要求,值对以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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文