From What does an assignment return? :
An assignment expression has the value of the left operand after the assignment
and this code:
#include <iostream>
using namespace std;
int main() {
int a[5] = { 0,1,2 };
int* a_ptr = a;
int b = (*a_ptr++ = 3); //int *b won't compile
cout << b << endl; //3
}
What is the left operand of =
when evaluating (*a_ptr++ = 3)
?
What's the definition of an operand? In my mind, an operand is an identifier or name which is aptr
.