Advertisement

compiler error

Started by March 07, 2002 07:48 PM
14 comments, last by hibiki_konzaki 22 years, 8 months ago
What does the error "Lvalue required in function Player::Fight"? I''m using a Borland C++ 5.5 compiler I downloaded off the internet.
HibikiWheres the any key?www.geocities.com/dragongames123/home.html
find your elementat mutedfaith.com.<º>
Did you forget to grab the docs for it?
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Advertisement
Lvalue means left value. You most likely have a variable name spelled wrong somewhere. Look for a place where you called a class function or used an array; those will usual give Lvalue errors rather than "unknown identifier"
What happens if you call a function that returns something without an lvalue?
An lvalue is a variable which can be the receptor of an assignment. In the statement a = 10;, a is an lvalue. 10 is not, so you can''t do 10 = a; or 10 = 5;

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!
Maybe you did something like this:

      3 = MyVar;// or4 = 4;  



If you did the above, in MSVC++, you would get:


  error C2106: '=' : left operand must be l-value  


Hope that helps

EDIT: Same thing Oluseyi is talking about, except with the nice source thingy.

Edited by - Programmer One on March 8, 2002 1:48:49 AM
Advertisement
Ok, I looked over the code and there was nothing like that in the code. There is alot of variables being changed, but nothing backwards..
HibikiWheres the any key?www.geocities.com/dragongames123/home.html
find your elementat mutedfaith.com.<º>
does the debug tell you which line your having a problem with? maybe you can check that line or the line before it. or post that line for us to see
You can''t assign to a const "variable" either.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
did you use something like this maybe?

#define number 5

number = 5

This topic is closed to new replies.

Advertisement