【发布时间】:2021-10-16 10:20:01
【问题描述】:
不知道,为什么会输出1024?
vector<int> default_container = { 1,2,3,4,5,6,7,78,8,1024 };
cout << *default_container.end() << endl; // 0
default_container.pop_back();
for (auto it : default_container)
{
cout << it << ",";
}
cout << endl;
cout << *default_container.end() << endl; // 1024 why?why?why?why?
cout << *--default_container.end() << endl; // 8
【问题讨论】:
标签: c++ c++11 iterator stdvector dereference