【发布时间】:2009-07-07 07:09:15
【问题描述】:
在下面的代码中,为什么当我获取地图索引(包含列表)的地址和获取列表本身的地址时,它们都有不同的值。
请参阅下面的代码进行说明。
#include <iostream>
#include <list>
#include <map>
using namespace std;
int main()
{
list<char> listA; //list of chars
map<int,list<char> > mapper; //int to char map
mapper[1] = listA;
cout << &(mapper[1]) << endl;
cout << &listA << endl;
}
【问题讨论】: