In your original code, what's 'a' initialized to?  It looks like 'a' is not 
initialized, so '++a' is incrementing an uninitialized variable as it seems to 
me.  Incrementing any variable that's not initialized yields unpredictable 
results to the best of my knowledge.  The compiler will init the variable with 
the current contents of the memory location prior to incrementing, which can be 
any value.  To get predictable results, one must always init your variables.  
One of the first lessons taught in my Intro to Programming class I took some 
years ago.

Reply via email to