得到以下編譯錯誤在Visual Studio '12pointIndex無法在C從向量檢索項++
error C3867: 'std::vector<_Ty>::at': function call missing argument list; use '&std::vector<_Ty>::at' to create a pointer to member line 39
CODE
Vector2dVector mVertices;
/// other code
for (int pointIndex = 0; pointIndex < points.size(); pointIndex++) {
mVertices.push_back(Vector2d(pointIndex * 2.0f, pointIndex * 3.0f));
}
int size = mVertices.size();
CCPoint *pointArr = new CCPoint[size];
for(int i = 0; i < size; i++) {
Vector2d vec2 = mVertices.at[i]; //Line 39
//pointArr[i].x = vec2->GetX();
//pointArr[i].y = vec2->GetY();
}
好吧,這是一個愚蠢的問題,我同意。我預計Visual Studio 2012的智能會爲此發出警告。 – asloob 2013-04-11 09:33:18
我認爲這不是一個「愚蠢的問題」:我們每個人都是初學者! :)享受學習。 – 2013-04-11 09:50:06