the for loop:
//for testing, this is usually a value of about 27
int test = level.PathLookupVectors()[globalNodePositionIndex][globalNodeChoice].size();
for (int i = 0; i < level.PathLookupVectors()[globalNodePositionIndex][globalNodeChoice].size(); i++)
{
//adds the correct nodes to the search
search.push_back(level.Nodes()[level.PathLookupVectors()[globalNodePositionIndex][globalNodeChoice][i]].Index());
}
and it’s a 64 bit system.
I’m getting very strange results for the integer ‘i’ when debugging. it should be initialized to 0 but for some reason it’s a very very high number which in turn means that the for loop is not executing.
You are almost certainly barking up the wrong tree. The code:
…initializes
ito0, period. If you’re trying to spy its value in the debugger and the debugger saysihas a value that looks like uninitialized, garbage data, then you are probably looking atieither before or afterihas entered scope and been initialized. For example, in MSVC if you examineibefore you enter the loop for the very first time, it will often have garbage data.These are not the droids you’re looking for. Move along.
Much more likely is this code:
This is probably not doing what you think it’s doing.
By the way, if the type of
level.PathLookupVectors()[globalNodePositionIndex][globalNodeChoice]is avectorof some kind, I’d prefer that you use aforloop constructed like this.If you don’t need the index of the element you’re trying to access, then why refer to it? You’re just introducing another potential failure point in your code.