Just a sample

回答: 第一题说明乱弹2009-05-09 17:15:29

class hotel {

public:
........
void printUncleanedrooms();

private:
map &lt int, bool&gt _roomStatus;
list &lt int &gt _uncleanedRooms;

};

void hotel::printUncleanedrooms() {
for(list &lt int &gt::iterator iter=_uncleanedRooms.begin(); iter!= _uncleanedRooms.end();) {
if(_roomStatus[*iter])
_uncleanedRooms.erase(iter++);
else
cout }
}

所有跟帖: 

need to add "++iter" in the second case -乱弹- 给 乱弹 发送悄悄话 乱弹 的博客首页 (0 bytes) () 05/10/2009 postreply 12:39:09

xiexie. -戏雨飞鹰- 给 戏雨飞鹰 发送悄悄话 戏雨飞鹰 的博客首页 (0 bytes) () 05/10/2009 postreply 13:59:08

请您先登陆,再发跟帖!