hi ...
can anyone please tell what are Lvalue and Rvalue errors in c and c++ ???

Recommended Answers

All 5 Replies

Like 3 = myVariable; Will generate an lvalue error, because you can't assign to a numeric constant.

You can't assign to a function, or assign to an array either.

commented: Helps +1

@joshilay
I don't think you get rvalue required errors.

@joshilay
I don't think you get rvalue required errors.

Maybe he just wanted to know the difference between the L and R values ?

hi ...
can anyone please tell what are Lvalue and Rvalue errors in c and c++ ???

Lvalue means location value. And Rvalue means read value.
Suppose the code is
int i;
i=5;
here i is lvalue and 5 is Rvalue.
the code 5=i;
generates error lvalue required.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.