
-----------------------------------
apomb
Thu Mar 03, 2005 1:00 pm

l-values?
-----------------------------------
i keep getting the error "left operand must be l-value"
in VC++ 6 ... please help

-----------------------------------
wtd
Thu Mar 03, 2005 1:23 pm

Re: l-values?
-----------------------------------
When you assign to something, that something has to be something you can assign to.  Such things are often called l-values.  Show me your code.

-----------------------------------
apomb
Thu Mar 03, 2005 6:56 pm


-----------------------------------
I'm at home right now, when i go back to school, ill post it, untill then, can you explain your explination again? ... all i got out of it was "show me your code"  :lol:

-----------------------------------
wtd
Thu Mar 03, 2005 9:16 pm


-----------------------------------
say you have 

int foo;

"foo" is an l-value you can assign to.

foo = 42;

But, if you have a function which returns an int, well you can't assign to that.

int bar() { return 42; }

bar() = 57;

The last doesn't work.

-----------------------------------
apomb
Fri Mar 04, 2005 6:16 pm


-----------------------------------
hmm, seems thats the thing ... ill try to rearrange the initialization of my varibles.

-----------------------------------
wtd
Fri Mar 04, 2005 6:18 pm


-----------------------------------
If you show me the code I can probably help you better, since I don't know which mistake you're making.  :)
