What the difference? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What the difference?

Hi everyone! Tell someone please why cout<<x++++; give an error and cout<<(x-++--x); give output?

21st Mar 2017, 3:45 PM
Татьяна Бойцова
Татьяна Бойцова - avatar
2 Answers
+ 15
cout << x-++--x; is actually interpreted as: cout << x - (++(--x)); and cout << x++++; is simply not legit.
21st Mar 2017, 4:00 PM
Hatsy Rei
Hatsy Rei - avatar
0
why not working (x++)++ as x+=2 after code string executed? simply not legit is not an answer i looking for here
22nd Mar 2017, 6:37 AM
Татьяна Бойцова
Татьяна Бойцова - avatar