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

C#

 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
N8tiv30-Apr-13 19:04
N8tiv30-Apr-13 19:04 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
OriginalGriff30-Apr-13 21:57
mveOriginalGriff30-Apr-13 21:57 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
N8tiv30-Apr-13 23:02
N8tiv30-Apr-13 23:02 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
OriginalGriff30-Apr-13 23:36
mveOriginalGriff30-Apr-13 23:36 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
N8tiv4-May-13 22:31
N8tiv4-May-13 22:31 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
OriginalGriff4-May-13 22:50
mveOriginalGriff4-May-13 22:50 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
N8tiv4-May-13 23:02
N8tiv4-May-13 23:02 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
OriginalGriff4-May-13 23:14
mveOriginalGriff4-May-13 23:14 
Laugh | :laugh: I like lightbulb moments!

Try this:
C#
int x = 10;
int y = 100;
int z = ++x + (y++ * x);
Console.WriteLine("x = {0}, y = {1}, z= {2}", x, y, z);
If you can work that out in your head, you are doing very, very well!

Normally, they don't get that complex - they are generally used for array indexes as such like:
C#
byte[] data = File.ReadAllBytes(@"D:\Temp\MyFile.txt");
int i = 0;
do
    {
    if (data[i++] == 'x')
        {
        break;
        }
    } while (i < data.Length);

The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)

GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
N8tiv4-May-13 23:48
N8tiv4-May-13 23:48 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
OriginalGriff4-May-13 23:58
mveOriginalGriff4-May-13 23:58 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
N8tiv5-May-13 0:04
N8tiv5-May-13 0:04 
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 
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 

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.