Home › Forums › C Programming › Lvalue and Rvalue
- This topic has 4 replies, 2 voices, and was last updated 14 years, 8 months ago by LouanneT01.
- AuthorPosts
- April 12, 2010 at 4:22 pm #2246LouanneT01Participant
plz anyone can tell me……how can we produce an error like lvalue and rvalue required.
basically lvalue stands for left value and rvalue for right value.
but i am unable to bring these errors in my programs…. - April 12, 2010 at 10:11 pm #3648GWILouisaxwzklaParticipant
An L-value violation is easy , just put a constant on the left hand side of an equation:
1234567<br />const int myInt = 9;<br /><br />..<br />myInt = 3; // need an L-value here<br /><br />You need something that is assignable for a L-value. R-value violations are tougher , I’ll have to look into this…….
- April 13, 2010 at 7:10 pm #3649LouanneT01Participant
hello sir,
so u have changed ur name from cman to dman…..
actually i know about LVALUE concept,but i m still alien about RVALUE.
please find it somewhere and reply…..also i have posted a problem for “program without header files”…please reply on that too.
thanks for replying.
napster14 - April 13, 2010 at 7:52 pm #3650GWILouisaxwzklaParticipant
For an R-value violation you could do this:
12345678910<br />void func ( int i );<br /><br />int main()<br />{<br />int i = func ( 3 );<br /><br />}<br /><br />pretty sure that would constitute a R-value violation…….
- April 14, 2010 at 7:34 am #3651LouanneT01Participant
thank you for both the answers…..
i’ll try them.
- AuthorPosts
- The forum ‘C Programming’ is closed to new topics and replies.