Can someone explain what am I doing wrong?
I get "vector subscript out of range" error.
Here is the sample ...
#include <vector>
using std::vector;
struct CUBE
{
int number;
bool changed;
};
int _tmain(int argc, _TCHAR* argv[])
{
vector<CUBE *> cube;
for (int i = 0; i < 5; i++)
{
cube[i] = new CUBE;
cube[i]->number = 0;
cube[i]->changed = false;
}
return 0;
}