473,811 Members | 2,979 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

lvalue?

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

May 27 '07 #1
4 2266
In article <11************ **********@n15g 2000prd.googleg roups.com>,
Shraddha <sh************ *@gmail.comwrot e:
>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.comwrit es:
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.comwrit es:
>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
36666
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 explanation, however, it may be too brief. Can anyone give me a more detailed explanation? Or give some referrences
9
3559
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 (lex.literal). A string literal is an *lvalue*; all other literals are *rvalues*. -4- The operator :: followed by an identifier, a qualified-id, or an operator-function-id is a primary-expression. Its type is specified by the
15
4902
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 caused several builds to break, most notably elfutils. Presumably this behavior is not part of the C standard and it is thus being excised like many other nonstandard GCC extensions. Regardless, my question is not about the specifics or...
24
2969
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 reading several old posts/threads on the subject, and they never end with a conclusion (people keep correcting each other and disagreeing).
9
13798
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 above expression is not an lvalue ? It both specifies the the storage location as well as the type of object ? When I try to increment it
3
5771
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 anything is lvalue and if cannot assign to anything then that anything is not lvalue.
10
2939
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
4387
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
3030
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
3003
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
9724
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10379
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10127
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9201
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7665
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5552
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.