Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# i++ meaning

// i++  means 'tell me the value of i, then increment'
// ++i  means 'increment i, then tell me the value'

int i = 0;
Console.WriteLine(i++); // Prints 0. Then value of "i" becomes 1.
Console.WriteLine(--i); // Value of "i" becomes 0. Then prints 0.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #meaning
ADD COMMENT
Topic
Name
4+5 =