0
++var and var++ always equal the same thing so why have ++var? It should not even exist. It seems redundant to me.
variables.
5 Réponses
+ 4
there is a significant difference and it's quite practical
+ 2
start back from basics man , pre-increment & post.
one simple a=5 ; b=a++,b=5,a=6 ; b=++a,b=6,a=6 ;comment if m wrong
+ 1
There is a difference between them.. as the former one is prefix-increment and the latter one is postfix increment. So after the operation performs on var then values which come will be different. The ++var first adds the value by one and prints the result whereas var++ first prints the value which is assigned and then increments its value by one.