学习使用vector日记
PointsCal CalTable, temp;
vector<PointsCal> AllCalTable;
1 int lenAllCalTable = AllCalTable.size();
for(int i = 0; i <= lenAllCalTable; ++i)
{
2 int lenAllCalTable = AllCalTable.size();
for(int i = 0; i <= lenAllCalTable; ++i)
{
在VS2010中,使用上述两种写法的时候会出现Debug Assertion Failed。使用下面的写法不会出现。
3 for(vector<PointsCal>::iterator p = AllCalTable.begin();p != AllCalTable.end(); ++p)
{
PointsCal CalTable, temp;
vector<PointsCal> AllCalTable;
1 int lenAllCalTable = AllCalTable.size();
for(int i = 0; i <= lenAllCalTable; ++i)
{
temp = AllCalTable.back();}
fileout<<"\t"<<temp.id<<"\t"<<temp.rotCor<<endl;
AllCalTable.pop_back();
2 int lenAllCalTable = AllCalTable.size();
for(int i = 0; i <= lenAllCalTable; ++i)
{
temp = AllCalTable[i];//temp = AllCalTable.at(i);}
fileout<<"\t"<<temp.id<<"\t"<<temp.rotCor<<endl;
在VS2010中,使用上述两种写法的时候会出现Debug Assertion Failed。使用下面的写法不会出现。
3 for(vector<PointsCal>::iterator p = AllCalTable.begin();p != AllCalTable.end(); ++p)
{
temp = *p;}
fileout<<"\t"<<temp.id<<"\t"<<temp.rotCor<<endl;