In several projects I have been working on lately, I have noticed something
occurring which I believe to be a bug in the compiler. I have noticed
this bug in both 2.00 and 2.01.
After assigning a value to a variable in one function, the value does
not remain the same in the next function that uses this variable. In
my most recent encounter with this bug, I was coding in C++ with some
simple classes. I have a public non-static int variable in a simple
class with no inheritence or anything special, and in this class's
constructor, I set this variable's value to 0 (zero). Later, a
different function receives an object (of same class that I was working
on) via a pointer, and I check the variable's value like so:
if(object->var == 0)
and the variable does not equal 0 (zero). The variable is not modified
or even examined in between the constructor and the function that examins
the variable of which I just described. The object, of course, had
been created in another function(it was a pointer '*'), and was passed as a
pointer ('*') as I just mentioned.
I have also encountered this before while I was working in C with
struct's in a similar situation.
Has anyone else had this happen to them, and if this is a bug, will
it be fixed? It is quite annoying and a real pain to work around.