My program keeps on crashing when x = 2
and y = 6
cellChargeTime[x][y].push_back(0);
Any ideas on how to fix this or what might be causing this crash.
vector<int> **cellChargeTime;
cellChargeTime = new vector<int>*[xMax]; //xMax = 40
for (int x=0; x<xMax; x++)
cellChargeTime[x] = new vector<int> [yMax]; //yMax = 40
for (int x=0; x<xMax; x++){
for (int y=0; y<yMax; y++){
for (int i=0; i< numRuns; i++){ //numRuns = 1
cellChargeTime[x][y].push_back(0); // Crashes at x = 2; y = 6
}
}
}
Aucun commentaire:
Enregistrer un commentaire