Strange variable swap problem

I have a structure called A, whose constructor looks like this

1
2
3
4
A::A() {
  N = new vector<neuron*>(INPUT);
  N_active = new vector<size_t>;
}


Whenever I run this constructor, the vector pointed to by N_active has a length of INPUT, and the vector pointed to by N has a length of 0. Furthermore, running this:

N_active->resize(0);

has no effect, but running this:

N->resize(0);

has the effect of reducing the size of N_active to 0... No I'm not mixing up the variable names, it's really doing that!

The memory locations pointed to by N_active and N are not the same. Does anyone have an explanation for this behaviour? It's really hard to figure out where this could come from. I'm using VS2010 Ultimate..
Forcing a full recompile of all source files fixed the problem. weird...
Forcing a full recompile of all source files fixed the problem. weird...


If you have been in IT line not enough, above is commonly seen. Another would be just re-start server or program and all problem resolved. Sometimes I wonder why such illogical stuff happen. For some cases, I can find out why, for others, I just say well some streak of luck going on ?
Topic archived. No new replies allowed.