Click here to Skip to main content
15,902,938 members
Home / Discussions / C#
   

C#

 
GeneralRe: Strange IL code from simple C# expression Pin
Andrew Kirillov23-Sep-05 1:13
Andrew Kirillov23-Sep-05 1:13 
AnswerRe: Strange IL code from simple C# expression Pin
User 665823-Sep-05 1:26
User 665823-Sep-05 1:26 
GeneralRe: Strange IL code from simple C# expression Pin
Andrew Kirillov23-Sep-05 1:27
Andrew Kirillov23-Sep-05 1:27 
AnswerRe: Strange IL code from simple C# expression Pin
sreejith ss nair23-Sep-05 2:37
sreejith ss nair23-Sep-05 2:37 
GeneralRe: Strange IL code from simple C# expression Pin
Andrew Kirillov23-Sep-05 2:41
Andrew Kirillov23-Sep-05 2:41 
GeneralRe: Strange IL code from simple C# expression Pin
sreejith ss nair23-Sep-05 2:44
sreejith ss nair23-Sep-05 2:44 
AnswerRe: Strange IL code from simple C# expression Pin
leppie23-Sep-05 3:01
leppie23-Sep-05 3:01 
AnswerRe: Strange IL code from simple C# expression Pin
Dave Kreskowiak23-Sep-05 5:55
mveDave Kreskowiak23-Sep-05 5:55 
Andrew Kirillov wrote:
int i = 5;
i = i++;


Easy, 5. The value of i is incremented after the expression is evaluated.

In this example:

Andrew Kirillov wrote:
int i = 5;
i = ++i;


Here, i will be 6. The value of i is incremented before the expression is evaluated.

This is all defined functionality in the C# language specification. C and C++ do the same thing.
7.5.9 Postfix increment and decrement operators[^]


RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: Strange IL code from simple C# expression Pin
Andrew Kirillov23-Sep-05 6:26
Andrew Kirillov23-Sep-05 6:26 
GeneralRe: Strange IL code from simple C# expression Pin
Wjousts23-Sep-05 6:45
Wjousts23-Sep-05 6:45 
GeneralRe: Strange IL code from simple C# expression Pin
Andrew Kirillov23-Sep-05 6:55
Andrew Kirillov23-Sep-05 6:55 
GeneralRe: Strange IL code from simple C# expression Pin
Wjousts23-Sep-05 8:56
Wjousts23-Sep-05 8:56 
GeneralRe: Strange IL code from simple C# expression Pin
Dave Kreskowiak23-Sep-05 9:17
mveDave Kreskowiak23-Sep-05 9:17 
GeneralRe: Strange IL code from simple C# expression Pin
Wjousts23-Sep-05 9:30
Wjousts23-Sep-05 9:30 
GeneralRe: Strange IL code from simple C# expression Pin
Dave Kreskowiak23-Sep-05 16:58
mveDave Kreskowiak23-Sep-05 16:58 
GeneralRe: Strange IL code from simple C# expression Pin
Wjousts24-Sep-05 3:33
Wjousts24-Sep-05 3:33 
GeneralRe: Strange IL code from simple C# expression Pin
Daniel Grunwald24-Sep-05 21:44
Daniel Grunwald24-Sep-05 21:44 
GeneralRe: Strange IL code from simple C# expression Pin
Dave Kreskowiak25-Sep-05 1:37
mveDave Kreskowiak25-Sep-05 1:37 
GeneralRe: Strange IL code from simple C# expression Pin
Wjousts25-Sep-05 3:29
Wjousts25-Sep-05 3:29 
GeneralRe: Strange IL code from simple C# expression Pin
Dave Kreskowiak26-Sep-05 1:20
mveDave Kreskowiak26-Sep-05 1:20 
GeneralRe: Strange IL code from simple C# expression Pin
Wjousts26-Sep-05 6:10
Wjousts26-Sep-05 6:10 
GeneralRe: Strange IL code from simple C# expression Pin
Dave Kreskowiak26-Sep-05 13:57
mveDave Kreskowiak26-Sep-05 13:57 
GeneralRe: Strange IL code from simple C# expression Pin
Wjousts26-Sep-05 23:21
Wjousts26-Sep-05 23:21 
GeneralRe: Strange IL code from simple C# expression Pin
Dave Kreskowiak27-Sep-05 14:25
mveDave Kreskowiak27-Sep-05 14:25 
GeneralRe: Strange IL code from simple C# expression Pin
Wjousts28-Sep-05 15:35
Wjousts28-Sep-05 15:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.