You are here:

C++/lValue required


What is lValue? Some of the C++ programs I have written, have flagged an error 'lValue required". So what is lValue?

Any help would be appreciated.

Hello Binoy, thank you for the question.

I have often wondered why they choose this word and not something more descriptive myself. You normally see that error when you try and do something like modify a constant. Here is an example:

int foo(const int x)
x += 5;
return x;

int main()
int g = 5;

This will produce the error of "lvalue required".

There are a couple of other things that can cause this error also. I believe if you try to add two pointers it will produce it.

I hope this information is helpful.

- Eddie


All Answers

Answers by Expert:

Ask Experts




I can answer questions about the C++ language, object oriented design and architecture. I am knowledgable in a lot of the math that goes into programming, and am certified by I also know a good deal about graphics via OpenGL, and GUIs.


I have completed numerous games and demos created with the C++ programming language. Currently employed as a software engineer in the modeling and simulation field. I have about 7 years experience.

©2017 All rights reserved.