This question already has an answer here:
- What is i+++ increment in c++ 3 answers
The expression z = x+++y;
is parsed as x++ + y
because output of my program is :
x : 2
y : 2
z : 3
My code:
#include <iostream>
using namespace std;
int main()
{
int x = 1, y = 2, z;
z = x+++y;
cout<<"x : "<<x<<endl<<"y : "<<y<<endl<<"z : "<<z<<endl;
return 0;
}
So, is x+++y
well-defined behaviour?
Aucun commentaire:
Enregistrer un commentaire