Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 l-values?
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
apomb




PostPosted: Thu Mar 03, 2005 1:00 pm   Post subject: l-values?

i keep getting the error "left operand must be l-value"
in VC++ 6 ... please help
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Thu Mar 03, 2005 1:23 pm   Post subject: 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




PostPosted: Thu Mar 03, 2005 6:56 pm   Post subject: (No subject)

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" Laughing
wtd




PostPosted: Thu Mar 03, 2005 9:16 pm   Post subject: (No subject)

say you have

code:
int foo;


"foo" is an l-value you can assign to.

code:
foo = 42;


But, if you have a function which returns an int, well you can't assign to that.

code:
int bar() { return 42; }


code:
bar() = 57;


The last doesn't work.
apomb




PostPosted: Fri Mar 04, 2005 6:16 pm   Post subject: (No subject)

hmm, seems thats the thing ... ill try to rearrange the initialization of my varibles.
wtd




PostPosted: Fri Mar 04, 2005 6:18 pm   Post subject: (No subject)

If you show me the code I can probably help you better, since I don't know which mistake you're making. Smile
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: