Really struggling with prefix and postfix operators
Can anybody help with some well explained examples, more the better.
for example: int x = 1; Console.WriteLine(x++); //It will print 1 then after printing, the x will be incremented by one. -- int x = 1; Console.WriteLine(++x); //the x will be incremented by one, then it will print 2. Hope that helps! :))
prefix- first operate on the variable and then use the value postfix- first use the value and then operate on the variable
thanks for an example @erwin