My question is maybe very simple, but I'm wondering what does this x+1 means? Let's see an example:
int main()
{
int x = 2;
x + 1; //1
if ((x - 2) && (x = 7)) { //2 and 3
// do something
}
}
What i know:
- That the assignment cannot be evaluated because left side of && will return false, so the conjunction will never be true.
Questions:
- How does the memory looks like after operation 1?
- Is the value of x changed after x-2 (2)?
I saw in debugger that this doesn't change the value of x, but I'm using a C++ compiler in Visual Studio so it can give another values.
Thanks in advance :)