base operand of `->' has non-pointer type

funnyone 2010-09-14 06:40:30
32 G:\代码\成对的字符串.cpp base operand of `->' has non-pointer type `std::map<int, int, std::less<int>, std::allocator<std::pair<const int, int> > >'

for(multimap<char,map<int,int> >::iterator itor=test.begin();itor!=test.end();++itor)
if(itor->second->first==1) //这一行
++itor->second->second; //每一次迭代增加每一个距离
...全文
2296 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
里面的那个map,也必须用iterator,那样才有->first
pengzhixi 2010-09-14
  • 打赏
  • 举报
回复
map可没有->first这样的操作。
  • 打赏
  • 举报
回复


multimap<char,vector<int> > s;
vector<int> ivc;

s.push_back(make_pare<'c', ivc>)
funnyone 2010-09-14
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 regainworld 的回复:]

->改成.试试
[/Quote]

不对,已经不能改啦,
键值不变也没意义啦
你说
multimap<char,vector<int> >如何添加值
regainworld 2010-09-14
  • 打赏
  • 举报
回复
->改成.试试
funnyone 2010-09-14
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 mstlq 的回复:]

最简单的类比……
C/C++ code

map<int, int> > test;
if (test->first==1) ++test->second;

楼主知道上面错在哪里吗?

请翻教材去吧……
[/Quote]

你说
multimap<char,vector<int> >如何添加值

刚才忽然想到map键值不能改变
mstlq 2010-09-14
  • 打赏
  • 举报
回复
最简单的类比……

map<int, int> > test;
if (test->first==1) ++test->second;

楼主知道上面错在哪里吗?

请翻教材去吧……
funnyone 2010-09-14
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 mstlq 的回复:]

itor->second是一个map
[/Quote]

我知道,那贼摸弄那个,map中的int呢?
mstlq 2010-09-14
  • 打赏
  • 举报
回复
itor->second是一个map
笔记本的风扇控制 ---------------------------------------- 09 November 2006. Summary of changes for version 20061109: 1) ACPI CA Core Subsystem: Optimized the Load ASL operator in the case where the source operand is an operation region. Simply map the operation region memory, instead of performing a bytewise read. (Region must be of type SystemMemory, see below.) Fixed the Load ASL operator for the case where the source operand is a region field. A buffer object is also allowed as the source operand. BZ 480 Fixed a problem where the Load ASL operator allowed the source operand to be an operation region of any type. It is now restricted to regions of type SystemMemory, as per the ACPI specification. BZ 481 Additional cleanup and optimizations for the new Table Manager code. AcpiEnable will now fail if all of the required ACPI tables are not loaded (FADT, FACS, DSDT). BZ 477 Added #pragma pack(8/4) to acobject.h to ensure that the structures in this header are always compiled as aligned. The ACPI_OPERAND_OBJECT has been manually optimized to be aligned and will not work if it is byte-packed. Example Code and Data Size: These are the sizes for the OS- independent acpica.lib produced by the Microsoft Visual C++ 6.0 32- bit compiler. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. Previous Release: Non-Debug Version: 78.1K Code, 17.1K Data, 95.2K Total Debug Version: 155.4K Code, 63.1K Data, 218.5K Total Current Release: Non-Debug Version: 77.9K Code, 17.0K Data, 94.9K Total Debug Version: 155.2K Code, 63.1K Data, 218.3K Total 2) iASL Compiler/Disassembler and Tools: Fixed a problem where the presence of the _OSI predefined control method within complex expressions could cause an internal compiler error. AcpiExec: Implemented full region support for multiple address spaces. SpaceId is now part of the REGION object. BZ 429 ---------------------------------------- 11 Oc

64,281

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧