It was an incomplete example <smile>. Yea, additional code would have been in a 
real program before the iteration happened.

--- On Sat, 7/18/09, Dan Presley <[email protected]> wrote:

From: Dan Presley <[email protected]>
Subject: [c-prog] Re: I am not agree with u.
To: [email protected]
Date: Saturday, July 18, 2009, 2:27 AM

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.



------------------------------------

To unsubscribe, send a blank message to 
<mailto:[email protected]>.Yahoo! Groups Links





[Non-text portions of this message have been removed]

Reply via email to