I have created this datastructure:
class Event
{
public:
Event(EVENT_TYPE type, void* pSender = 0, int content1 = 0,
int content2 = 0, int content3 = 0, int content4 = 0);
~Event(void);
// ... some functions
protected:
EVENT_TYPE itsType;
void* itsPointerToSender;
int itsContent_1;
int itsContent_2;
int itsContent_3;
int itsContent_4;
int numStacked;
};
whose constructor is simply
Event::Event(EVENT_TYPE type, void* pSender, int content1, int content2, int content3, int content4)
: itsType(type),
itsPointerToSender(pSender),
itsContent_1(content1),
itsContent_2(content2),
itsContent_3(content3),
itsContent_4(content4),
numStacked(0)
{
}
For some strange reason I can't understand, the VS debugger cannot and will not show me whatever is contained in itsContent_4
. If I put a watch on the variable, itsContent_4
gives me a symbol "itsContent_4" not found
while doing the same thing with itsContent_3
works perfectly. I'm not sure the variable even exists as far as the compiler is concerned!
Am I missing something here?
Edit: Now it seems (even stranger) that changing the order of the variables in the declaration creates an even bigger mess! I tried placing itsContent_4
before itsContent_1
and now itsContent_1
is being initialized with the value intended for itsContent_4
! What is going on here? I'm suspecting something to do with naming, so I'll try renaming them all and see what happens.
Edit 2: Yes, apparently changing the variable names to itsContent_a
instead of itsContent_1
and so forth works perfectly. Is there some restriction as to using numbers in a variable name?