0
Whats the difference between x=++4 and x=+4 and x=4++
just confused about the double operators
5 Answers
+ 3
all of those are errors...
what you probably meant :
x++ increment x but returns the old value
++x increment x but returns the new value
x += 4 adds 4 to x (notice its +=, not =+ like you wrote)
+ 2
just to make it clear : you cannot use ++ on constants, only on variables (and if we talk about c++ here , then these variables must never be const)
+ 2
example:
cout << a[x++] ;
// print values indexed by x and increment x to next element of a
0
thank you :D
0
x++ increments but returns the old value, so what's the point of that? in the code does it use the incremented value?