Click here to Skip to main content
15,887,430 members
Home / Discussions / C#
   

C#

 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
OriginalGriff5-May-13 0:11
mveOriginalGriff5-May-13 0:11 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
N8tiv5-May-13 0:17
N8tiv5-May-13 0:17 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
N8tiv5-May-13 0:19
N8tiv5-May-13 0:19 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
N8tiv5-May-13 0:05
N8tiv5-May-13 0:05 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
OriginalGriff5-May-13 0:21
mveOriginalGriff5-May-13 0:21 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
N8tiv5-May-13 0:24
N8tiv5-May-13 0:24 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
OriginalGriff5-May-13 0:28
mveOriginalGriff5-May-13 0:28 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
Kevin Bewley29-Apr-13 0:30
Kevin Bewley29-Apr-13 0:30 
This line is the important one:
int z = y-- + x;

it says to the computer, assign y + x into a variable called z. When you've done that knock one off the stored value of y.

so, in the line int z = y-- + x; z gets assigned with 100 + 10 (110) then y gets reduced to 99.

In the line z = --z + x;

The operation goes; knock one off z then assign the sum of z + x to z.
ie. take 1 off 110(z) to get 109; THEN assign 109+10 to z.

Basically if the ++ or -- is BEFORE the variable name (--y) then the operation is done BEFORE the rest of the line. But, if the ++ or -- is AFTER the variable name, the operation is done AFTER the rest of the line. Simples! Smile | :)
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
harold aptroot29-Apr-13 0:38
harold aptroot29-Apr-13 0:38 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
Kevin Bewley29-Apr-13 0:40
Kevin Bewley29-Apr-13 0:40 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
harold aptroot29-Apr-13 0:43
harold aptroot29-Apr-13 0:43 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
N8tiv5-May-13 0:29
N8tiv5-May-13 0:29 
Questionwhy you can't store a lambda expression in a 'dynamic variable, or 'var variable ? Pin
BillWoodruff27-Apr-13 18:33
professionalBillWoodruff27-Apr-13 18:33 
AnswerRe: why you can't store a lambda expression in a 'dynamic variable, or 'var variable ? Pin
SledgeHammer0127-Apr-13 18:54
SledgeHammer0127-Apr-13 18:54 
GeneralRe: why you can't store a lambda expression in a 'dynamic variable, or 'var variable ? Pin
BillWoodruff27-Apr-13 19:41
professionalBillWoodruff27-Apr-13 19:41 
GeneralRe: why you can't store a lambda expression in a 'dynamic variable, or 'var variable ? Pin
SledgeHammer0127-Apr-13 20:07
SledgeHammer0127-Apr-13 20:07 
AnswerRe: why you can't store a lambda expression in a 'dynamic variable, or 'var variable ? Pin
Richard Deeming29-Apr-13 2:19
mveRichard Deeming29-Apr-13 2:19 
GeneralRe: why you can't store a lambda expression in a 'dynamic variable, or 'var variable ? Pin
BillWoodruff29-Apr-13 14:07
professionalBillWoodruff29-Apr-13 14:07 
QuestionExtract Date part and pass only Date Pin
meeram3927-Apr-13 4:24
professionalmeeram3927-Apr-13 4:24 
AnswerRe: Extract Date part and pass only Date Pin
Dave Kreskowiak27-Apr-13 5:31
mveDave Kreskowiak27-Apr-13 5:31 
AnswerRe: Extract Date part and pass only Date Pin
jschell27-Apr-13 11:15
jschell27-Apr-13 11:15 
GeneralJogar uma imagem em um picturibox, apartir de um clique em uma linha do datagridview Pin
Member 1000184526-Apr-13 13:15
Member 1000184526-Apr-13 13:15 
GeneralRe: Jogar uma imagem em um picturibox, apartir de um clique em uma linha do datagridview Pin
dusty_dex26-Apr-13 13:36
dusty_dex26-Apr-13 13:36 
GeneralRe: Jogar uma imagem em um picturibox, apartir de um clique em uma linha do datagridview Pin
Member 1000184526-Apr-13 15:30
Member 1000184526-Apr-13 15:30 
GeneralRe: Jogar uma imagem em um picturibox, apartir de um clique em uma linha do datagridview Pin
Dave Kreskowiak26-Apr-13 17:16
mveDave Kreskowiak26-Apr-13 17:16 

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.