Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
715 views
in Technique[技术] by (71.8m points)

c - lvalue required

what does the error message "Lvalue required" actually mean?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

An lvalue is something that can appear on the left side of an assignment, in other words 'something that can be assigned'

So, look for an assignment where the left hand side isn't 'assignable', for example, something as simple as this might trigger such an error

if (0 = foo)
{

}

Here you've got an attempt to assign to a constant because of accidentally using = rather than ==

See also


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...