Okay, guys - take a look at this problem I’m having with C++ & MS Visual C++ 6.0…
-
Lets say you made a simple structure. It contains afew integers and a DirectDraw7 surface pointer…
-
You name this structure “Struct_1”.
-
You then make an array of “Struct_1” structures. Say…maybe…50 elements. The name for this array is “array[50]”.
-
Now then, you also have another structure - but a totally different one! It comes from an entirely different template. And you also made an arrary of it…say 10,000 elements. It also contains integers & one DD7-surface pointer…
-
During runtime you write code to change one of Struct_1’s integers like so…
array[0].first_integer = 1;
…and you know for a fact that is the exact code - because you wrote it!
-
However, at runtime - it doesn’t do this! It insted changes a variable in one of the structure-elements in the other array! A COMPLETELY DIFFERENT ARRAY!!! And the vaule in “array[0].first_integer” is 0…
-
Now lets say you then checked the code for any possible incorrect pointer-assignments etc and found none!
…how is this possible? I’ve checked my source code for all assignments regarding these two different arrays and they NEVER asigned values to each other.
This has really got me stumped!:banghead:


