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

New Message on MumbaiUserGroup

-----------------------------------------------------------
From: VaibhavModak
Message 4 in Discussion

Hi, I checked the code both in C# and C++ and its indeed working as you said. This is 
what I found in MSDN for Postfix operator in Visual C#.        The run-time processing 
of a postfix increment or decrement operation of the form x++ or x-- consists of the 
following steps:         If x is classified as a variable:    x is evaluated to 
produce the variable.         The value of x is saved.        The selected operator is 
invoked with the saved value of x as its argument.     The value returned by the 
operator is stored in the location given by the evaluation of x.      The saved value 
of x becomes the result of the operation.  
So if you check your code, since you are using the same variable to get the result 
c=c++; 
It is saving the original value of c in the same variable before incrementing it.  
When you come back to the same operation in the loop, again the value of c is 0. Thats 
why you get 0,0,0,0,0. 
Hope that clears your doubt.

Regarding your doubt about why this doesn't happen the same way in C,C++ I am still 
searching for an answer.

Will get back to you as soon as I get something... 
 
Regards, 
Vaibhav Modak

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

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/MumbaiUserGroup/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to