473,386 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

lvalue?

Sometimes we get an error of lvalue requred?What exactly is the lvalue?
And when this error occures?

May 27 '07 #1
4 2248
In article <11**********************@n15g2000prd.googlegroups .com>,
Shraddha <sh*************@gmail.comwrote:
>Sometimes we get an error of lvalue requred?What exactly is the lvalue?
And when this error occures?
What did you come up with when you googled for lvalue ?

--
There are some ideas so wrong that only a very intelligent person
could believe in them. -- George Orwell
May 27 '07 #2
Shraddha <sh*************@gmail.comwrites:
Sometimes we get an error of lvalue requred?What exactly is the lvalue?
Informally speaking, an lvalue is an expression that can appear
on the left side of an assignment operator. Generally, an lvalue
is an expression that designates an object (a region of memory):
a variable, a dereferenced pointer, etc. In fact in C the
definition of an lvalue is different from what this informal idea
would suggest, but this is a reasonable place to start thinking
about them.
--
Comp-sci PhD expected before end of 2007
Seeking industrial or academic position *outside California* in 2008
May 27 '07 #3
Ben Pfaff wrote:
Shraddha <sh*************@gmail.comwrites:
>Sometimes we get an error of lvalue requred?What exactly is the lvalue?

Informally speaking, an lvalue is an expression that can appear
on the left side of an assignment operator. Generally, an lvalue
is an expression that designates an object (a region of memory):
a variable, a dereferenced pointer, etc. In fact in C the
definition of an lvalue is different from what this informal idea
would suggest, but this is a reasonable place to start thinking
about them.
And there's plenty of stuff in the archives on this topic,
some of it more off-topic (but historically interesting)
than others.

[You get an "lvalue required" message when you are supposed
to have an lvalue but you didn't supply one; a typical
example would be assigning to an array or something++.]

--
Double Plus Good Hedgehog
The "good old days" used to be much better.

May 27 '07 #4
Shraddha wrote:
Sometimes we get an error of lvalue requred?What exactly is the lvalue?
And when this error occures?
This is a FAQ, check Question 20.39b.

Let say i is a int, then consider the assignment

i = i + 1;

here the r.h.s "i" is an int value, while the identifier "i" on the l.h.s.
refers to something very different, namely a memory location.

Hence, l-value is the value of "i" on the l.h.s of the assignment, while
r-value refer to the value of the identifier on the r.h.s.

--
Tor <torust [at] online [dot] no>

May 27 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Hongzheng Wang | last post by:
In K&R, they said: An object is a named region of storage; an lvalue is an expression refer to an object. How about these concept in C++? `The C++ Programming Language' has a similar...
9
by: Steven T. Hatton | last post by:
This is from the draft of the previous version of the Standard: http://www.kuzbass.ru:8086/docs/isocpp/expr.html 2- A literal is a primary expression. Its type depends on its form...
15
by: Michael Baehr | last post by:
I recently upgraded my Arch Linux system to GCC 3.4, and found out that a previously accepted behavior (cast-as-lvalue) is now marked as deprecated, and will cease to function in GCC 3.5. This has...
24
by: Romeo Colacitti | last post by:
Hi, Does anyone here have a strong understanding for the meanings of the terms "lvalue" and "rvalue" as it pertains to C, objects, and different contexts? If so please share. I've been...
9
by: junky_fellow | last post by:
Consider the following piece of code: (char *)0x100; /* I know that converting an integer to pointer type is implementation defined. But forget this for a moment */ My question is, Why the...
3
by: Kavya | last post by:
Can someone give and explain in simple terms a definition of lvalue? Also what are these modifiable and non-modifiable lvalues? I always thought that, if we can assign to anything then that...
10
by: the_init | last post by:
Hi friends, I read about Lvalue in previous posting and Googled it but I'm not understood it completely. There is a small doubt. int a; a=20; // here a is Lvalue But
14
by: nobrow | last post by:
Yes I know what lvalue means, but what I want to ask you guys about is what are all valid lvalues ... a *a a *(a + 1) .... What else?
6
by: Yarco | last post by:
I've alway thought lvalue means Left Value and rvalue means Right Value before i've read someone's article. It is said "lvalue = location value" and "rvalue = read value". Which one is right, then?
33
by: Pietro Cerutti | last post by:
Hi group, assume the following declarations: char *func_1(void); void func_2(char **); I am allowed to do: char *c = func_1();
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.