I am learning C# in csharp station website but theres one part I am little confused and the tutorial doesnt offer any explanation.
Here is the code:
Expand|Select|Wrap|Line Numbers
- using System;
- class Unary
- {
- public static void Main()
- {
- int unary = 0;
- int preIncrement;
- int preDecrement;
- int postIncrement;
- int postDecrement;
- int positive;
- int negative;
- sbyte bitNot;
- bool logNot;
- preIncrement = ++unary;
- Console.WriteLine("pre-Increment: {0}", preIncrement);
My understanding is that {0} refers to the 1st Argument since unary which is set to 0 is incremennted before copied over to preIncrement, shouldnt the output be 1 instead of 0?
Cheers