c++ - Assignment operator
-
Christof Meerwald
(20/20)
Dec 23 2002
#include
#include <stdio.h> int main() { int a; int *j = &(a = 0); // Error: lvalue expected *j = 1; printf("%d\n", a); (a = 2) = 3; // Error: lvalue expected printf("%d\n", a); return 0; } See 5.17 Assignment operators [expr.ass]: "... the result is an lvalue." BTW, this one is low priority. bye, Christof -- http://cmeerw.org JID: cmeerw jabber.at mailto cmeerw at web.de ...and what have you contributed to the Net?
Dec 23 2002