473,385 Members | 1,736 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,385 software developers and data experts.

Why do people call addresses "pointers"?

Hi,

I'm just wondering why people/books/experts say "the function returns a
pointer to.." or "we have to send scanf a pointer to.." instead of "the
function returns the address of.." or "we have to send scanf the
address of.."

Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?

Why do people refer to the (r)values moving around in a program as
pointers? (Am I missing something, or just reading too much into a
non-issue?)

[I've noticed that experts almost never say "address of", but often
time beginners do... there must be something to it]

Nov 14 '05 #1
46 2195
In article <11**********************@f14g2000cwb.googlegroups .com>,
TTroy <ti*****@gmail.com> wrote:
I'm just wondering why people/books/experts say "the function returns a
pointer to.." or "we have to send scanf a pointer to.." instead of "the
function returns the address of.." or "we have to send scanf the
address of.."
Pointer is just a more abstract term, while address is more
implementational. You could for example implement C in some other
language without an access to real addresses, by using indexes into a
large array as pointers.
[I've noticed that experts almost never say "address of", but often
time beginners do... there must be something to it]


The C standard (in most places) uses the term "pointer".

-- Richard

Nov 14 '05 #2

"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I'm just wondering why people/books/experts say "the function returns a
pointer to.." or "we have to send scanf a pointer to.." instead of "the
function returns the address of.." or "we have to send scanf the
address of.."
AFAIK "pointer" is a logical construct, which is usually (in C) resolved
into an adress. For most C compilers the two terms are equivalent, but this
is not always the case. Specifically all kinds of segment constructions can
fuzzify the issue.
Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?
Nope.
Why do people refer to the (r)values moving around in a program as
pointers? (Am I missing something, or just reading too much into a
non-issue?)
I suspect the latter.
[I've noticed that experts almost never say "address of", but often
time beginners do... there must be something to it]


Address of is clearer, but not always correct.
Nov 14 '05 #3
j

"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I'm just wondering why people/books/experts say "the function returns a
pointer to.." or "we have to send scanf a pointer to.." instead of "the
function returns the address of.." or "we have to send scanf the
address of.."

Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?


The value of an expression can be an address, yes. But just what does
that tell you about the type of the value?

An lvalue is not necessarily a pointer. Consider the following,

int foo;

foo = 10;

Is foo a pointer?
If you answered ``yes'', then I recommend you buy a book on C.

--
j
Nov 14 '05 #4

j wrote:
"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I'm just wondering why people/books/experts say "the function returns a pointer to.." or "we have to send scanf a pointer to.." instead of "the function returns the address of.." or "we have to send scanf the
address of.."
subject of post clearly established above

Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?
a question asked about the subject

The value of an expression can be an address, yes. But just what does
that tell you about the type of the value?

An lvalue is not necessarily a pointer. Consider the following,

int foo;

foo = 10;

Is foo a pointer?


totally unrelated question above

If you answered ``yes'', then I recommend you buy a book on C.


The subject of my post was pointers to & addresses of.
Why are you presenting me with a question about an int variable?
Several years ago I did read a book that told me that the "context" of
a statement or sentence affects it's meaning. Have you read any
similar books?

Nov 14 '05 #5
j

"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

j wrote:
"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I'm just wondering why people/books/experts say "the function returns a pointer to.." or "we have to send scanf a pointer to.." instead of "the function returns the address of.." or "we have to send scanf the
address of.."
subject of post clearly established above

Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?
a question asked about the subject


The value of an expression can be an address, yes. But just what does
that tell you about the type of the value?

An lvalue is not necessarily a pointer. Consider the following,

int foo;

foo = 10;

Is foo a pointer?


totally unrelated question above

If you answered ``yes'', then I recommend you buy a book on C.


The subject of my post was pointers to & addresses of.
Why are you presenting me with a question about an int variable?
Several years ago I did read a book that told me that the "context" of
a statement or sentence affects it's meaning. Have you read any
similar books?


You are not good at this reading business are you?
The point of that was even though a pointer to an object
may be used as an lvalue, not all lvalues are a pointer
to an object. ``foo'' is an object with an object type of ``int''
and is not a pointer to such an object.

This answers your question ``Isn't the lvalue called a POINTER TO''

--
j
Nov 14 '05 #6
On 2005-01-31 10:55:50 -0500, "j" <ja**********@bellsouth.net> said:

"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

j wrote:
"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I'm just wondering why people/books/experts say "the function returns a
pointer to.." or "we have to send scanf a pointer to.." instead of

"the
function returns the address of.." or "we have to send scanf the
address of.."


subject of post clearly established above

Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?


a question asked about the subject


The value of an expression can be an address, yes. But just what does
that tell you about the type of the value?

An lvalue is not necessarily a pointer. Consider the following,

int foo;

foo = 10;

Is foo a pointer?


totally unrelated question above

If you answered ``yes'', then I recommend you buy a book on C.


The subject of my post was pointers to & addresses of.
Why are you presenting me with a question about an int variable?
Several years ago I did read a book that told me that the "context" of
a statement or sentence affects it's meaning. Have you read any
similar books?


You are not good at this reading business are you?


I think it may be you that needs to brush up on reading comprehension.
The point of that was even though a pointer to an object
may be used as an lvalue, not all lvalues are a pointer
to an object. ``foo'' is an object with an object type of ``int''
and is not a pointer to such an object.

This answers your question ``Isn't the lvalue called a POINTER TO''


Again, you've totally missed the context that the OP provided. That
question was *only* withing the context of pointers and addresses.
Though, of course, the answer turned out to be "no", your answer is
totally irrelevant.

To help you understand the OP's question, you can break it into the
following two questions:
1) When a pointer or address is used as an lvalue, is it called a "pointer"?
2) When a pointer or address is used as a non-lvalue, is it called an
"address"?

(This doesn't change the answer

--
Clark S. Cox, III
cl*******@gmail.com

Nov 14 '05 #7
j

"Clark S. Cox III" <cl*******@gmail.com> wrote in message
news:2005013111564516807%clarkcox3@gmailcom...
On 2005-01-31 10:55:50 -0500, "j" <ja**********@bellsouth.net> said:

"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

j wrote:
"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
> Hi,
>
> I'm just wondering why people/books/experts say "the function
returns a
> pointer to.." or "we have to send scanf a pointer to.." instead of
"the
> function returns the address of.." or "we have to send scanf the
> address of.."

subject of post clearly established above

>
> Isn't the lvalue called a POINTER TO and the (r)value called the
> ADDRESS OF?

a question asked about the subject

>

The value of an expression can be an address, yes. But just what does
that tell you about the type of the value?

An lvalue is not necessarily a pointer. Consider the following,

int foo;

foo = 10;

Is foo a pointer?

totally unrelated question above
If you answered ``yes'', then I recommend you buy a book on C.

The subject of my post was pointers to & addresses of.
Why are you presenting me with a question about an int variable?
Several years ago I did read a book that told me that the "context" of
a statement or sentence affects it's meaning. Have you read any
similar books?

You are not good at this reading business are you?


I think it may be you that needs to brush up on reading comprehension.
The point of that was even though a pointer to an object
may be used as an lvalue, not all lvalues are a pointer
to an object. ``foo'' is an object with an object type of ``int''
and is not a pointer to such an object.

This answers your question ``Isn't the lvalue called a POINTER TO''


Again, you've totally missed the context that the OP provided. That
question was *only* withing the context of pointers and addresses.
Though, of course, the answer turned out to be "no", your answer is
totally irrelevant.

To help you understand the OP's question, you can break it into the
following two questions:
1) When a pointer or address is used as an lvalue, is it called a

"pointer"? 2) When a pointer or address is used as a non-lvalue, is it called an
"address"?

(This doesn't change the answer

--
Clark S. Cox, III
cl*******@gmail.com


I inferred from what he said not from what he meant to say.

Suppose we did have some function that returned a pointer
to some object, then the value it returns is the value of that
expression.

If we pass a pointer to some object to scanf, we also have
a value of an expression in this context too. Whether this
value is then used as an lvalue within scanf is irrelevant to
what he asked.

From this, he follows with the question of ``isn't an lvalue a pointer to''.
lvalues are in a completely different context from what he was
previously talking about. lvalues designate objects! This has absolutely
nothing to do with values of expressions. As such, my response stands
relevant to the question ``isn't an lvalue a pointer to''. It is not my
problem if he is incapable of expressing himself with the English
language.

--
j
Nov 14 '05 #8
In article <11**********************@f14g2000cwb.googlegroups .com>
TTroy <ti*****@gmail.com> wrote:
I'm just wondering why people/books/experts say "the function returns a
pointer to.." or "we have to send scanf a pointer to.." instead of "the
function returns the address of.." or "we have to send scanf the
address of.."

Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?
No.

Suppose I write:

sizeof(int *)

What is the parenthesized "int *" here? Is it an lvalue? Is it an
rvalue?

The last two questions can be safely answered with "no" and "no"
respectively -- it is neither an lvalue nor an rvalue. The answer
to the first question is that it is a type-name. The type named is
"pointer to int".

What a pointer *is*, then, is part of a type-name. Formally,
a variable (object) of type "int *" holds a value of type "int *":

int *p;
...
p = <some expression>

The <expression> here must have type "pointer to int", or be directly
convert-able to that type, e.g., from malloc():

p = malloc(N * sizeof *p); /* get room for N items */

(here we have a value of type "void *" on the right hand side of
the "=" assignment operator, and "void *" can be converted to "int *").

Simple textbook examples generally start with something like:

int i;
int *p;
...
p = &i;

Here the unary "&" (or "address-of") operator "takes the address"
of the ordinary variable "i", producing a value of type "pointer
to int", pointing to i.

If we then write either:

ret = scanf("%d", p);
or: ret = scanf("%d", &i);

the same thing happens in both cases: scanf() gets, as its second
value, the address of the variable "i": a value of type "pointer
to int", pointing to "i". (The first value is the address of the
first element of the array holding the sequence {'%', 'd', '\0'},
which is a value of type "char *".)

All values in C always have types. Most of the time, when we speak
or write informally, we believe that both the speaker/writer and
listener/reader already understand this and agree as to all the
types, so we just talk about the "value part" of the <type,value>
pair. That is, we do not go around saying:

start i at int 0, then add int 1 each trip through the loop

We omit the "int" part each time. If we do the same with pointers,
we might start with something like:

scanf("%d", &i)

call scanf, passing as the first value a value of type "char *"
pointing to the percent sign in the three-character array holding
the %d format directive, and passing as the second value a value
of type "int *" pointing to the local variable named "i"

(the full, formal version) and end up with:

call scanf with a pointer to "i"

or even more colloquially:

give scanf the address of "i"

but these all *mean* the same thing.
Why do people refer to the (r)values moving around in a program as
pointers? (Am I missing something, or just reading too much into a
non-issue?)
I think the last. :-)
[I've noticed that experts almost never say "address of", but often
time beginners do... there must be something to it]


I prefer to reserve the term "address of" for the unary-& operator
myself, but this is something of a matter of taste.
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
Nov 14 '05 #9

j wrote:
"Clark S. Cox III" <cl*******@gmail.com> wrote in message
news:2005013111564516807%clarkcox3@gmailcom...
On 2005-01-31 10:55:50 -0500, "j" <ja**********@bellsouth.net> said:

"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
>
> j wrote:
>> "TTroy" <ti*****@gmail.com> wrote in message
>> news:11**********************@f14g2000cwb.googlegr oups.com...
>>> Hi,
>>>
>>> I'm just wondering why people/books/experts say "the function
> returns a
>>> pointer to.." or "we have to send scanf a pointer to.." instead of> "the
>>> function returns the address of.." or "we have to send scanf the>>> address of.."
>
> subject of post clearly established above
>
>>>
>>> Isn't the lvalue called a POINTER TO and the (r)value called the>>> ADDRESS OF?
>
> a question asked about the subject
>
>>>
>>
>> The value of an expression can be an address, yes. But just what does>> that tell you about the type of the value?
>>
>> An lvalue is not necessarily a pointer. Consider the following,
>>
>> int foo;
>>
>> foo = 10;
>>
>> Is foo a pointer?
>
> totally unrelated question above
>
>>
>> If you answered ``yes'', then I recommend you buy a book on C.
>>
>>
>
> The subject of my post was pointers to & addresses of.
> Why are you presenting me with a question about an int variable?
> Several years ago I did read a book that told me that the "context" of> a statement or sentence affects it's meaning. Have you read any
> similar books?
>

You are not good at this reading business are you?
I think it may be you that needs to brush up on reading comprehension.
The point of that was even though a pointer to an object
may be used as an lvalue, not all lvalues are a pointer
to an object. ``foo'' is an object with an object type of ``int''
and is not a pointer to such an object.

This answers your question ``Isn't the lvalue called a POINTER
TO''
Again, you've totally missed the context that the OP provided. That
question was *only* withing the context of pointers and addresses.
Though, of course, the answer turned out to be "no", your answer is
totally irrelevant.

To help you understand the OP's question, you can break it into the
following two questions:
1) When a pointer or address is used as an lvalue, is it called a

"pointer"?
2) When a pointer or address is used as a non-lvalue, is it called an "address"?

(This doesn't change the answer

--
Clark S. Cox, III
cl*******@gmail.com


I inferred from what he said not from what he meant to say.

Suppose we did have some function that returned a pointer
to some object, then the value it returns is the value of that
expression.

If we pass a pointer to some object to scanf, we also have
a value of an expression in this context too. Whether this
value is then used as an lvalue within scanf is irrelevant to
what he asked.

From this, he follows with the question of ``isn't an lvalue a

pointer to''. lvalues are in a completely different context from what he was
previously talking about. lvalues designate objects! This has absolutely nothing to do with values of expressions. As such, my response stands
relevant to the question ``isn't an lvalue a pointer to''. It is not my problem if he is incapable of expressing himself with the English
language.


If you had told me that I'm inexperienced with C, and I would take it
as constructive criticism. Instead you go an talk about my lack of
English skills. Are you trying to prove to the world that you're the
biggest idiot alive with your comments? For your information, I speak
know 4 languages and English isn't my first. Nevertheless, I find it
ridiculous that someone of your intelligence is rating my English
skills, when it is you who's a little deficient upstairs.

English (and most other languages) is built on the idea of using
"contexts" to infer meanings of sentences/phrases/paragraphs/etc. Why
do you think a book has: a title, chapters(with more titles), sections
within chapters, paragraphs within sections, sentences withing
paragraphs? One doesn't hold the meaning of a sentence based solely on
just that sentence. That would mean every book would be 10 000+ pages
long with constant repetition.

Who in their right mind will start off a topic talking about pointers &
addresses, mention a sentence about lvalues/rvalues of pointers and
then mention an unrelated sentence about lvalues/rvalues right after
it? Do you do that type of thing in your writing? My niece in grade 2
can figure out that the second sentence that refers to lvalues/rvalues
is "connected" to the previous sentence that also mentions
lvalues/rvalues (which has a direct link with pointers & addresses
established in it).

"The bears loved to eat berries from the ABC trees."
"They always ate them fresh off the trees, never stored them for
later."

My niece knows exactly what the second sentence is referring to. You're
probably reading it thinking: "Who is they? What is them? Which trees?"

On a similar note:
==================
Why does the English language have pronouns? So you're telling me,
every sentence you read that has the words "her", "it", "that" make no
sense to you? Those authors must have poor English skills, right? You
must only read those 10 000+ page books where everything is repeated
explicity.

By the way, did you notice the title of my original post? Well that
doesn't matter, each sentence has an isolated meaning, right?

Nov 14 '05 #10
j

"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

j wrote:
"Clark S. Cox III" <cl*******@gmail.com> wrote in message
news:2005013111564516807%clarkcox3@gmailcom...
On 2005-01-31 10:55:50 -0500, "j" <ja**********@bellsouth.net> said:
>
> "TTroy" <ti*****@gmail.com> wrote in message
> news:11**********************@f14g2000cwb.googlegr oups.com...
>>
>> j wrote:
>>> "TTroy" <ti*****@gmail.com> wrote in message
>>> news:11**********************@f14g2000cwb.googlegr oups.com...
>>>> Hi,
>>>>
>>>> I'm just wondering why people/books/experts say "the function
>> returns a
>>>> pointer to.." or "we have to send scanf a pointer to.." instead of >> "the
>>>> function returns the address of.." or "we have to send scanf the >>>> address of.."
>>
>> subject of post clearly established above
>>
>>>>
>>>> Isn't the lvalue called a POINTER TO and the (r)value called the >>>> ADDRESS OF?
>>
>> a question asked about the subject
>>
>>>>
>>>
>>> The value of an expression can be an address, yes. But just what does >>> that tell you about the type of the value?
>>>
>>> An lvalue is not necessarily a pointer. Consider the following,
>>>
>>> int foo;
>>>
>>> foo = 10;
>>>
>>> Is foo a pointer?
>>
>> totally unrelated question above
>>
>>>
>>> If you answered ``yes'', then I recommend you buy a book on C.
>>>
>>>
>>
>> The subject of my post was pointers to & addresses of.
>> Why are you presenting me with a question about an int variable?
>> Several years ago I did read a book that told me that the "context" of >> a statement or sentence affects it's meaning. Have you read any
>> similar books?
>>
>
> You are not good at this reading business are you?

I think it may be you that needs to brush up on reading comprehension.
> The point of that was even though a pointer to an object
> may be used as an lvalue, not all lvalues are a pointer
> to an object. ``foo'' is an object with an object type of ``int''
> and is not a pointer to such an object.
>
> This answers your question ``Isn't the lvalue called a POINTER TO''
Again, you've totally missed the context that the OP provided. That
question was *only* withing the context of pointers and addresses.
Though, of course, the answer turned out to be "no", your answer is
totally irrelevant.

To help you understand the OP's question, you can break it into the
following two questions:
1) When a pointer or address is used as an lvalue, is it called a

"pointer"?
2) When a pointer or address is used as a non-lvalue, is it called an "address"?

(This doesn't change the answer

--
Clark S. Cox, III
cl*******@gmail.com


I inferred from what he said not from what he meant to say.

Suppose we did have some function that returned a pointer
to some object, then the value it returns is the value of that
expression.

If we pass a pointer to some object to scanf, we also have
a value of an expression in this context too. Whether this
value is then used as an lvalue within scanf is irrelevant to
what he asked.

From this, he follows with the question of ``isn't an lvalue a

pointer to''.
lvalues are in a completely different context from what he was
previously talking about. lvalues designate objects! This has

absolutely
nothing to do with values of expressions. As such, my response stands
relevant to the question ``isn't an lvalue a pointer to''. It is not

my
problem if he is incapable of expressing himself with the English
language.


<snipped babbling>

You went from talking about values of expressions and
why they may be referred to as ``pointer to..'' or ``an address''
to asking ``isn't the lvalue a pointer to?''. Your first question
had nothing to do with lvalues. Which I have already explained.
You are asking a separate question about whether an lvalue
is a ``pointer to''. My counter-example showed that an lvalue
does not necessarily mean ``pointer to''. You can certainly
use a pointer to a valid object as an lvalue but this does not
imply that all lvalues are a pointer to some object.

--
j
Nov 14 '05 #11

j wrote:
"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

j wrote:
"Clark S. Cox III" <cl*******@gmail.com> wrote in message
news:2005013111564516807%clarkcox3@gmailcom...
> On 2005-01-31 10:55:50 -0500, "j" <ja**********@bellsouth.net> said:
>
> >
> > "TTroy" <ti*****@gmail.com> wrote in message
> > news:11**********************@f14g2000cwb.googlegr oups.com...
> >>
> >> j wrote:
> >>> "TTroy" <ti*****@gmail.com> wrote in message
> >>> news:11**********************@f14g2000cwb.googlegr oups.com... > >>>> Hi,
> >>>>
> >>>> I'm just wondering why people/books/experts say "the function > >> returns a
> >>>> pointer to.." or "we have to send scanf a pointer to.."

instead of
> >> "the
> >>>> function returns the address of.." or "we have to send scanf
the
> >>>> address of.."
> >>
> >> subject of post clearly established above
> >>
> >>>>
> >>>> Isn't the lvalue called a POINTER TO and the (r)value
called the
> >>>> ADDRESS OF?
> >>
> >> a question asked about the subject
> >>
> >>>>
> >>>
> >>> The value of an expression can be an address, yes. But just

what does
> >>> that tell you about the type of the value?
> >>>
> >>> An lvalue is not necessarily a pointer. Consider the
following, > >>>
> >>> int foo;
> >>>
> >>> foo = 10;
> >>>
> >>> Is foo a pointer?
> >>
> >> totally unrelated question above
> >>
> >>>
> >>> If you answered ``yes'', then I recommend you buy a book on C. > >>>
> >>>
> >>
> >> The subject of my post was pointers to & addresses of.
> >> Why are you presenting me with a question about an int variable? > >> Several years ago I did read a book that told me that the

"context" of
> >> a statement or sentence affects it's meaning. Have you read any > >> similar books?
> >>
> >
> > You are not good at this reading business are you?
>
> I think it may be you that needs to brush up on reading

comprehension.
>
> > The point of that was even though a pointer to an object
> > may be used as an lvalue, not all lvalues are a pointer
> > to an object. ``foo'' is an object with an object type of ``int'' > > and is not a pointer to such an object.
> >
> > This answers your question ``Isn't the lvalue called a POINTER TO''
>
> Again, you've totally missed the context that the OP provided.
That > question was *only* withing the context of pointers and addresses. > Though, of course, the answer turned out to be "no", your answer is > totally irrelevant.
>
> To help you understand the OP's question, you can break it into the > following two questions:
> 1) When a pointer or address is used as an lvalue, is it called a "pointer"?
> 2) When a pointer or address is used as a non-lvalue, is it called an
> "address"?
>
> (This doesn't change the answer
>
> --
> Clark S. Cox, III
> cl*******@gmail.com
>

I inferred from what he said not from what he meant to say.

Suppose we did have some function that returned a pointer
to some object, then the value it returns is the value of that
expression.

If we pass a pointer to some object to scanf, we also have
a value of an expression in this context too. Whether this
value is then used as an lvalue within scanf is irrelevant to
what he asked.

From this, he follows with the question of ``isn't an lvalue a

pointer to''.
lvalues are in a completely different context from what he was
previously talking about. lvalues designate objects! This has

absolutely
nothing to do with values of expressions. As such, my response
stands relevant to the question ``isn't an lvalue a pointer to''. It is

not my
problem if he is incapable of expressing himself with the English
language.


<snipped babbling>


You went from talking about values of expressions and
why they may be referred to as ``pointer to..'' or ``an address''
to asking ``isn't the lvalue a pointer to?''. Your first question
had nothing to do with lvalues.
You say my first question had nothing to do with lvalues. You're a
genius.
Which I have already explained.
You are asking a separate question about whether an lvalue
is a ``pointer to''. My counter-example showed that an lvalue
does not necessarily mean ``pointer to''. You can certainly
use a pointer to a valid object as an lvalue but this does not
imply that all lvalues are a pointer to some object.


Why do you insist on adding proof to my claim that you're a high
calibre idiot?
Your writing is horrible, and you sure as heck can't read.

The first question in my post was: "Isn't the lvalue called a POINTER
TO and the (r)value called the ADDRESS OF?"

Before that I had a paragraph that builds the context up before I
unleashed the question(and the title helped too). And even to let the
marginally retarted like you know that the question was related to
previous context, I used "the lvalue" instead of "a lvalue." That
"the" links that sentence strongly with the previous one, but even with
an "a" there, an average idiot could have figured out the connection.
But as you've shown, you're no average idiot.

In your most recent response (above), you say that my first question
had nothing to do with lvalues. So I wonder what the word "lvalue" in
the question was placed there for? Maybe I'm as dumb as you, so I just
plugged that word in for no reason, knowing that seasoned veterans of
idiocy will just ignore it.

I can't believe you're still responding and increasing your status as a
top quality idiot.

Nov 14 '05 #12
j

"TTroy" <ti*****@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...

j wrote:
"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

j wrote:
> "Clark S. Cox III" <cl*******@gmail.com> wrote in message
> news:2005013111564516807%clarkcox3@gmailcom...
> > On 2005-01-31 10:55:50 -0500, "j" <ja**********@bellsouth.net>
said:
> >
> > >
> > > "TTroy" <ti*****@gmail.com> wrote in message
> > > news:11**********************@f14g2000cwb.googlegr oups.com...
> > >>
> > >> j wrote:
> > >>> "TTroy" <ti*****@gmail.com> wrote in message
> > >>> news:11**********************@f14g2000cwb.googlegr oups.com... > > >>>> Hi,
> > >>>>
> > >>>> I'm just wondering why people/books/experts say "the function > > >> returns a
> > >>>> pointer to.." or "we have to send scanf a pointer to.."
instead of
> > >> "the
> > >>>> function returns the address of.." or "we have to send scanf the
> > >>>> address of.."
> > >>
> > >> subject of post clearly established above
> > >>
> > >>>>
> > >>>> Isn't the lvalue called a POINTER TO and the (r)value called the
> > >>>> ADDRESS OF?
> > >>
> > >> a question asked about the subject
> > >>
> > >>>>
> > >>>
> > >>> The value of an expression can be an address, yes. But just
what does
> > >>> that tell you about the type of the value?
> > >>>
> > >>> An lvalue is not necessarily a pointer. Consider the following, > > >>>
> > >>> int foo;
> > >>>
> > >>> foo = 10;
> > >>>
> > >>> Is foo a pointer?
> > >>
> > >> totally unrelated question above
> > >>
> > >>>
> > >>> If you answered ``yes'', then I recommend you buy a book on C. > > >>>
> > >>>
> > >>
> > >> The subject of my post was pointers to & addresses of.
> > >> Why are you presenting me with a question about an int variable? > > >> Several years ago I did read a book that told me that the
"context" of
> > >> a statement or sentence affects it's meaning. Have you read any > > >> similar books?
> > >>
> > >
> > > You are not good at this reading business are you?
> >
> > I think it may be you that needs to brush up on reading
comprehension.
> >
> > > The point of that was even though a pointer to an object
> > > may be used as an lvalue, not all lvalues are a pointer
> > > to an object. ``foo'' is an object with an object type of ``int'' > > > and is not a pointer to such an object.
> > >
> > > This answers your question ``Isn't the lvalue called a POINTER TO''
> >
> > Again, you've totally missed the context that the OP provided. That > > question was *only* withing the context of pointers and addresses. > > Though, of course, the answer turned out to be "no", your answer is > > totally irrelevant.
> >
> > To help you understand the OP's question, you can break it into the > > following two questions:
> > 1) When a pointer or address is used as an lvalue, is it called a > "pointer"?
> > 2) When a pointer or address is used as a non-lvalue, is it called an
> > "address"?
> >
> > (This doesn't change the answer
> >
> > --
> > Clark S. Cox, III
> > cl*******@gmail.com
> >
>
> I inferred from what he said not from what he meant to say.
>
> Suppose we did have some function that returned a pointer
> to some object, then the value it returns is the value of that
> expression.
>
> If we pass a pointer to some object to scanf, we also have
> a value of an expression in this context too. Whether this
> value is then used as an lvalue within scanf is irrelevant to
> what he asked.
>
> From this, he follows with the question of ``isn't an lvalue a
pointer to''.
> lvalues are in a completely different context from what he was
> previously talking about. lvalues designate objects! This has
absolutely
> nothing to do with values of expressions. As such, my response stands > relevant to the question ``isn't an lvalue a pointer to''. It is not my
> problem if he is incapable of expressing himself with the English
> language.
>


<snipped babbling>


You went from talking about values of expressions and
why they may be referred to as ``pointer to..'' or ``an address''
to asking ``isn't the lvalue a pointer to?''. Your first question
had nothing to do with lvalues.


You say my first question had nothing to do with lvalues. You're a
genius.
Which I have already explained.
You are asking a separate question about whether an lvalue
is a ``pointer to''. My counter-example showed that an lvalue
does not necessarily mean ``pointer to''. You can certainly
use a pointer to a valid object as an lvalue but this does not
imply that all lvalues are a pointer to some object.


Why do you insist on adding proof to my claim that you're a high
calibre idiot?
Your writing is horrible, and you sure as heck can't read.

The first question in my post was: "Isn't the lvalue called a POINTER
TO and the (r)value called the ADDRESS OF?"

Before that I had a paragraph that builds the context up before I
unleashed the question(and the title helped too). And even to let the
marginally retarted like you know that the question was related to
previous context, I used "the lvalue" instead of "a lvalue." That
"the" links that sentence strongly with the previous one, but even with
an "a" there, an average idiot could have figured out the connection.
But as you've shown, you're no average idiot.

In your most recent response (above), you say that my first question
had nothing to do with lvalues. So I wonder what the word "lvalue" in
the question was placed there for? Maybe I'm as dumb as you, so I just
plugged that word in for no reason, knowing that seasoned veterans of
idiocy will just ignore it.

I can't believe you're still responding and increasing your status as a
top quality idiot.


To quote you,
``I'm just wondering why people/books/experts say "the function returns a
pointer to.." or "we have to send scanf a pointer to.." instead of "the
function returns the address of.." or "we have to send scanf the
address of.." '' ...

.... is a question in itself. Even without an explicit question mark.
Which means that it is your initial question. So what is the problem?

In fact, observe the other responses to your initial post. This question
was the first one addressed. :)

Why do you think that is?

Oh, look at the inclusion of the word ``why'' near the start of that
sentence.
What do you think that conveys to the reader?

Additionally, your use of ``the lvalue'' is referring to the concept here
not to anything relating to your initial question. Unless you can provide
reasoning as to how your initial question had anything to do with
an lvalue. I suspect that you cannot.

--
j
Nov 14 '05 #13

j wrote:
"TTroy" <ti*****@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...

j wrote:
"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
>
> j wrote:
> > "Clark S. Cox III" <cl*******@gmail.com> wrote in message
> > news:2005013111564516807%clarkcox3@gmailcom...
> > > On 2005-01-31 10:55:50 -0500, "j" <ja**********@bellsouth.net> > said:
> > >
> > > >
> > > > "TTroy" <ti*****@gmail.com> wrote in message
> > > > news:11**********************@f14g2000cwb.googlegr oups.com... > > > >>
> > > >> j wrote:
> > > >>> "TTroy" <ti*****@gmail.com> wrote in message
> > > >>> news:11**********************@f14g2000cwb.googlegr oups.com...
> > > >>>> Hi,
> > > >>>>
> > > >>>> I'm just wondering why people/books/experts say "the

function
> > > >> returns a
> > > >>>> pointer to.." or "we have to send scanf a pointer to.." > instead of
> > > >> "the
> > > >>>> function returns the address of.." or "we have to send

scanf
> the
> > > >>>> address of.."
> > > >>
> > > >> subject of post clearly established above
> > > >>
> > > >>>>
> > > >>>> Isn't the lvalue called a POINTER TO and the (r)value

called
> the
> > > >>>> ADDRESS OF?
> > > >>
> > > >> a question asked about the subject
> > > >>
> > > >>>>
> > > >>>
> > > >>> The value of an expression can be an address, yes. But just > what does
> > > >>> that tell you about the type of the value?
> > > >>>
> > > >>> An lvalue is not necessarily a pointer. Consider the

following,
> > > >>>
> > > >>> int foo;
> > > >>>
> > > >>> foo = 10;
> > > >>>
> > > >>> Is foo a pointer?
> > > >>
> > > >> totally unrelated question above
> > > >>
> > > >>>
> > > >>> If you answered ``yes'', then I recommend you buy a book on
C.
> > > >>>
> > > >>>
> > > >>
> > > >> The subject of my post was pointers to & addresses of.
> > > >> Why are you presenting me with a question about an int

variable?
> > > >> Several years ago I did read a book that told me that
the > "context" of
> > > >> a statement or sentence affects it's meaning. Have you read any
> > > >> similar books?
> > > >>
> > > >
> > > > You are not good at this reading business are you?
> > >
> > > I think it may be you that needs to brush up on reading
> comprehension.
> > >
> > > > The point of that was even though a pointer to an object
> > > > may be used as an lvalue, not all lvalues are a pointer
> > > > to an object. ``foo'' is an object with an object type of

``int''
> > > > and is not a pointer to such an object.
> > > >
> > > > This answers your question ``Isn't the lvalue called a

POINTER
> TO''
> > >
> > > Again, you've totally missed the context that the OP
provided. That
> > > question was *only* withing the context of pointers and

addresses.
> > > Though, of course, the answer turned out to be "no", your

answer is
> > > totally irrelevant.
> > >
> > > To help you understand the OP's question, you can break it
into the
> > > following two questions:
> > > 1) When a pointer or address is used as an lvalue, is it
called a
> > "pointer"?
> > > 2) When a pointer or address is used as a non-lvalue, is it

called
> an
> > > "address"?
> > >
> > > (This doesn't change the answer
> > >
> > > --
> > > Clark S. Cox, III
> > > cl*******@gmail.com
> > >
> >
> > I inferred from what he said not from what he meant to say.
> >
> > Suppose we did have some function that returned a pointer
> > to some object, then the value it returns is the value of
that > > expression.
> >
> > If we pass a pointer to some object to scanf, we also have
> > a value of an expression in this context too. Whether this
> > value is then used as an lvalue within scanf is irrelevant to
> > what he asked.
> >
> > From this, he follows with the question of ``isn't an lvalue a > pointer to''.
> > lvalues are in a completely different context from what he was > > previously talking about. lvalues designate objects! This has
> absolutely
> > nothing to do with values of expressions. As such, my response stands
> > relevant to the question ``isn't an lvalue a pointer to''.
It is not
> my
> > problem if he is incapable of expressing himself with the
English > > language.
> >

<snipped babbling>


You went from talking about values of expressions and
why they may be referred to as ``pointer to..'' or ``an address''
to asking ``isn't the lvalue a pointer to?''. Your first question
had nothing to do with lvalues.


You say my first question had nothing to do with lvalues. You're a
genius.
Which I have already explained.
You are asking a separate question about whether an lvalue
is a ``pointer to''. My counter-example showed that an lvalue
does not necessarily mean ``pointer to''. You can certainly
use a pointer to a valid object as an lvalue but this does not
imply that all lvalues are a pointer to some object.


Why do you insist on adding proof to my claim that you're a high
calibre idiot?
Your writing is horrible, and you sure as heck can't read.

The first question in my post was: "Isn't the lvalue called a

POINTER TO and the (r)value called the ADDRESS OF?"

Before that I had a paragraph that builds the context up before I
unleashed the question(and the title helped too). And even to let the marginally retarted like you know that the question was related to
previous context, I used "the lvalue" instead of "a lvalue." That
"the" links that sentence strongly with the previous one, but even with an "a" there, an average idiot could have figured out the connection. But as you've shown, you're no average idiot.

In your most recent response (above), you say that my first question had nothing to do with lvalues. So I wonder what the word "lvalue" in the question was placed there for? Maybe I'm as dumb as you, so I just plugged that word in for no reason, knowing that seasoned veterans of idiocy will just ignore it.

I can't believe you're still responding and increasing your status as a top quality idiot.


To quote you,
``I'm just wondering why people/books/experts say "the function

returns a pointer to.." or "we have to send scanf a pointer to.." instead of "the function returns the address of.." or "we have to send scanf the
address of.." '' ...

... is a question in itself. Even without an explicit question mark.
Which means that it is your initial question. So what is the problem?

The first sentence could be taken as a "call for a response," but it's
not a question. It could be considered "similar" to a "question" if it
wasn't followed by an actual question that triggered the context that
the first sentenced built up. Since I used a question to connect to
the previous context, most people would not consider the first sentence
as an independent "call for a response" (it's not a question period!).


In fact, observe the other responses to your initial post. This question was the first one addressed. :)

Why do you think that is?
What is your point? You responded to the actual first question, not
the first sentence (go and check).

Oh, look at the inclusion of the word ``why'' near the start of that
sentence.
What does this sentence mean to you? : "He wonders 'why' idiots don't
stop."
Is that a question? It uses the word "why!!!"

How about this sentence? : "It doesn't matter 'when' he'll understand
he's an idiot, he's only out to prove supremacy in his field of
idiocy."
Is that a question? It uses the word "when!!!"
What do you think that conveys to the reader?
Depends on whether or not the reader was a supreme idiot. Since I
didn't intend for my target audience to include idiots, most that
responded understood fine, except this one individual.

Additionally, your use of ``the lvalue'' is referring to the concept here not to anything relating to your initial question. Unless you can provide reasoning as to how your initial question had anything to do with
an lvalue. I suspect that you cannot.


English is my 4th language, and let me guess, it must be your 10+th?
What are you talking about in the passage above? What do you mean by
"here." You're using the word "here" without any sort of proper
context for it built up, and you complain about my lack of clarity.

I'm a mechanical engineer trying to learn the ins/outs of C. Just
because you're more familiar with C than me, that doesn't give you the
right to bash anything but my C skills (like my English).

Nov 14 '05 #14
j

"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...

j wrote:
"TTroy" <ti*****@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...

j wrote:
> "TTroy" <ti*****@gmail.com> wrote in message
> news:11**********************@f14g2000cwb.googlegr oups.com...
> >
> > j wrote:
> > > "Clark S. Cox III" <cl*******@gmail.com> wrote in message
> > > news:2005013111564516807%clarkcox3@gmailcom...
> > > > On 2005-01-31 10:55:50 -0500, "j" <ja**********@bellsouth.net> > > said:
> > > >
> > > > >
> > > > > "TTroy" <ti*****@gmail.com> wrote in message
> > > > > news:11**********************@f14g2000cwb.googlegr oups.com... > > > > >>
> > > > >> j wrote:
> > > > >>> "TTroy" <ti*****@gmail.com> wrote in message
> > > > >>>
news:11**********************@f14g2000cwb.googlegr oups.com...
> > > > >>>> Hi,
> > > > >>>>
> > > > >>>> I'm just wondering why people/books/experts say "the
function
> > > > >> returns a
> > > > >>>> pointer to.." or "we have to send scanf a pointer to.." > > instead of
> > > > >> "the
> > > > >>>> function returns the address of.." or "we have to send
scanf
> > the
> > > > >>>> address of.."
> > > > >>
> > > > >> subject of post clearly established above
> > > > >>
> > > > >>>>
> > > > >>>> Isn't the lvalue called a POINTER TO and the (r)value
called
> > the
> > > > >>>> ADDRESS OF?
> > > > >>
> > > > >> a question asked about the subject
> > > > >>
> > > > >>>>
> > > > >>>
> > > > >>> The value of an expression can be an address, yes. But just > > what does
> > > > >>> that tell you about the type of the value?
> > > > >>>
> > > > >>> An lvalue is not necessarily a pointer. Consider the
following,
> > > > >>>
> > > > >>> int foo;
> > > > >>>
> > > > >>> foo = 10;
> > > > >>>
> > > > >>> Is foo a pointer?
> > > > >>
> > > > >> totally unrelated question above
> > > > >>
> > > > >>>
> > > > >>> If you answered ``yes'', then I recommend you buy a book on C.
> > > > >>>
> > > > >>>
> > > > >>
> > > > >> The subject of my post was pointers to & addresses of.
> > > > >> Why are you presenting me with a question about an int
variable?
> > > > >> Several years ago I did read a book that told me that the > > "context" of
> > > > >> a statement or sentence affects it's meaning. Have you read any
> > > > >> similar books?
> > > > >>
> > > > >
> > > > > You are not good at this reading business are you?
> > > >
> > > > I think it may be you that needs to brush up on reading
> > comprehension.
> > > >
> > > > > The point of that was even though a pointer to an object
> > > > > may be used as an lvalue, not all lvalues are a pointer
> > > > > to an object. ``foo'' is an object with an object type of
``int''
> > > > > and is not a pointer to such an object.
> > > > >
> > > > > This answers your question ``Isn't the lvalue called a
POINTER
> > TO''
> > > >
> > > > Again, you've totally missed the context that the OP provided. That
> > > > question was *only* withing the context of pointers and
addresses.
> > > > Though, of course, the answer turned out to be "no", your
answer is
> > > > totally irrelevant.
> > > >
> > > > To help you understand the OP's question, you can break it into the
> > > > following two questions:
> > > > 1) When a pointer or address is used as an lvalue, is it called a
> > > "pointer"?
> > > > 2) When a pointer or address is used as a non-lvalue, is it
called
> > an
> > > > "address"?
> > > >
> > > > (This doesn't change the answer
> > > >
> > > > --
> > > > Clark S. Cox, III
> > > > cl*******@gmail.com
> > > >
> > >
> > > I inferred from what he said not from what he meant to say.
> > >
> > > Suppose we did have some function that returned a pointer
> > > to some object, then the value it returns is the value of that > > > expression.
> > >
> > > If we pass a pointer to some object to scanf, we also have
> > > a value of an expression in this context too. Whether this
> > > value is then used as an lvalue within scanf is irrelevant to
> > > what he asked.
> > >
> > > From this, he follows with the question of ``isn't an lvalue a > > pointer to''.
> > > lvalues are in a completely different context from what he was > > > previously talking about. lvalues designate objects! This has
> > absolutely
> > > nothing to do with values of expressions. As such, my response stands
> > > relevant to the question ``isn't an lvalue a pointer to''. It is not
> > my
> > > problem if he is incapable of expressing himself with the English > > > language.
> > >
>
> <snipped babbling>

>
> You went from talking about values of expressions and
> why they may be referred to as ``pointer to..'' or ``an address''
> to asking ``isn't the lvalue a pointer to?''. Your first question
> had nothing to do with lvalues.

You say my first question had nothing to do with lvalues. You're a
genius.

> Which I have already explained.
> You are asking a separate question about whether an lvalue
> is a ``pointer to''. My counter-example showed that an lvalue
> does not necessarily mean ``pointer to''. You can certainly
> use a pointer to a valid object as an lvalue but this does not
> imply that all lvalues are a pointer to some object.
>

Why do you insist on adding proof to my claim that you're a high
calibre idiot?
Your writing is horrible, and you sure as heck can't read.

The first question in my post was: "Isn't the lvalue called a POINTER TO and the (r)value called the ADDRESS OF?"

Before that I had a paragraph that builds the context up before I
unleashed the question(and the title helped too). And even to let the marginally retarted like you know that the question was related to
previous context, I used "the lvalue" instead of "a lvalue." That
"the" links that sentence strongly with the previous one, but even with an "a" there, an average idiot could have figured out the connection. But as you've shown, you're no average idiot.

In your most recent response (above), you say that my first question had nothing to do with lvalues. So I wonder what the word "lvalue" in the question was placed there for? Maybe I'm as dumb as you, so I just plugged that word in for no reason, knowing that seasoned veterans of idiocy will just ignore it.

I can't believe you're still responding and increasing your status as a top quality idiot.

To quote you,
``I'm just wondering why people/books/experts say "the function

returns a
pointer to.." or "we have to send scanf a pointer to.." instead of

"the
function returns the address of.." or "we have to send scanf the
address of.." '' ...

... is a question in itself. Even without an explicit question mark.
Which means that it is your initial question. So what is the problem?


The first sentence could be taken as a "call for a response," but it's
not a question. It could be considered "similar" to a "question" if it
wasn't followed by an actual question that triggered the context that
the first sentenced built up. Since I used a question to connect to
the previous context, most people would not consider the first sentence
as an independent "call for a response" (it's not a question period!).


In fact, observe the other responses to your initial post. This

question
was the first one addressed. :)

Why do you think that is?


What is your point? You responded to the actual first question, not
the first sentence (go and check).

Oh, look at the inclusion of the word ``why'' near the start of that
sentence.


What does this sentence mean to you? : "He wonders 'why' idiots don't
stop."
Is that a question? It uses the word "why!!!"


Different context. I referred you to your initial question which
included ``why'' near the start of the sentence. You are making
an inquiry as to the reasoning behind calling ``addresses'',
``pointers''.
How about this sentence? : "It doesn't matter 'when' he'll understand
he's an idiot, he's only out to prove supremacy in his field of
idiocy."
Is that a question? It uses the word "when!!!"
Different context.
What do you think that conveys to the reader?


Depends on whether or not the reader was a supreme idiot. Since I
didn't intend for my target audience to include idiots, most that
responded understood fine, except this one individual.


I think your excessive use of the word ``idiot'' makes youl ook foolish.
You aren't showing incontravertibly that, that is true. So it has no
bearing. :)

Additionally, your use of ``the lvalue'' is referring to the concept

here
not to anything relating to your initial question. Unless you can

provide
reasoning as to how your initial question had anything to do with
an lvalue. I suspect that you cannot.


English is my 4th language, and let me guess, it must be your 10+th?


Irrelevant.
What are you talking about in the passage above? What do you mean by
"here." You're using the word "here" without any sort of proper
context for it built up, and you complain about my lack of clarity.
It was written in response to your post. The post I was responding
to serves as providing proper context. If I were to exclude your
post from my response, then I would not be providing proper
context.

I'm a mechanical engineer trying to learn the ins/outs of C.
I don't care.
Just
because you're more familiar with C than me, that doesn't give you the
right to bash anything but my C skills (like my English).


Oh stop your bloody whinging. It is really off-topic for this newsgroup.
The main point here is that your initial question,

``I'm just wondering why people/books/experts say "the function returns a
pointer to.." or "we have to send scanf a pointer to.." instead of "the
function returns the address of.." or "we have to send scanf the
address of.." '' ...

.... has absolutely nothing to do with lvalues. What part of that do you not
understand? So relating your second question to the first in this regard,
is absolutely meaningless. Try and answer this question again, since
you completely ignored it in your response. I asked you, to what lvalue
were you referring to?

I'll make it extremely simple for you.

First question,
``I'm just wondering why people/books/experts say "the function returns a
pointer to.." or "we have to send scanf a pointer to.." instead of "the
function returns the address of.." or "we have to send scanf the
address of.." ''

Second question,
``Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?''

Where is the lvalue that you are referring to in the first question?
I see no such lvalue mentioned.

--
j
Nov 14 '05 #15

j wrote:
"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...

j wrote:
"TTroy" <ti*****@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
>
> j wrote:
> > "TTroy" <ti*****@gmail.com> wrote in message
> > news:11**********************@f14g2000cwb.googlegr oups.com...
> > >
> > > j wrote:
> > > > "Clark S. Cox III" <cl*******@gmail.com> wrote in message
> > > > news:2005013111564516807%clarkcox3@gmailcom...
> > > > > On 2005-01-31 10:55:50 -0500, "j" <ja**********@bellsouth.net>
> > > said:
> > > > >
> > > > > >
> > > > > > "TTroy" <ti*****@gmail.com> wrote in message
> > > > > >

news:11**********************@f14g2000cwb.googlegr oups.com...
> > > > > >>
> > > > > >> j wrote:
> > > > > >>> "TTroy" <ti*****@gmail.com> wrote in message
> > > > > >>>
> news:11**********************@f14g2000cwb.googlegr oups.com...
> > > > > >>>> Hi,
> > > > > >>>>
> > > > > >>>> I'm just wondering why people/books/experts say "the > function
> > > > > >> returns a
> > > > > >>>> pointer to.." or "we have to send scanf a pointer

to.."
> > > instead of
> > > > > >> "the
> > > > > >>>> function returns the address of.." or "we have to send > scanf
> > > the
> > > > > >>>> address of.."
> > > > > >>
> > > > > >> subject of post clearly established above
> > > > > >>
> > > > > >>>>
> > > > > >>>> Isn't the lvalue called a POINTER TO and the (r)value > called
> > > the
> > > > > >>>> ADDRESS OF?
> > > > > >>
> > > > > >> a question asked about the subject
> > > > > >>
> > > > > >>>>
> > > > > >>>
> > > > > >>> The value of an expression can be an address, yes. But
just
> > > what does
> > > > > >>> that tell you about the type of the value?
> > > > > >>>
> > > > > >>> An lvalue is not necessarily a pointer. Consider
the > following,
> > > > > >>>
> > > > > >>> int foo;
> > > > > >>>
> > > > > >>> foo = 10;
> > > > > >>>
> > > > > >>> Is foo a pointer?
> > > > > >>
> > > > > >> totally unrelated question above
> > > > > >>
> > > > > >>>
> > > > > >>> If you answered ``yes'', then I recommend you buy a

book on
> C.
> > > > > >>>
> > > > > >>>
> > > > > >>
> > > > > >> The subject of my post was pointers to & addresses of. > > > > > >> Why are you presenting me with a question about an int > variable?
> > > > > >> Several years ago I did read a book that told me that
the
> > > "context" of
> > > > > >> a statement or sentence affects it's meaning. Have
you read
> any
> > > > > >> similar books?
> > > > > >>
> > > > > >
> > > > > > You are not good at this reading business are you?
> > > > >
> > > > > I think it may be you that needs to brush up on reading
> > > comprehension.
> > > > >
> > > > > > The point of that was even though a pointer to an
object > > > > > > may be used as an lvalue, not all lvalues are a pointer > > > > > > to an object. ``foo'' is an object with an object type of > ``int''
> > > > > > and is not a pointer to such an object.
> > > > > >
> > > > > > This answers your question ``Isn't the lvalue called a > POINTER
> > > TO''
> > > > >
> > > > > Again, you've totally missed the context that the OP

provided.
> That
> > > > > question was *only* withing the context of pointers and
> addresses.
> > > > > Though, of course, the answer turned out to be "no", your > answer is
> > > > > totally irrelevant.
> > > > >
> > > > > To help you understand the OP's question, you can break it into
> the
> > > > > following two questions:
> > > > > 1) When a pointer or address is used as an lvalue, is
it called
> a
> > > > "pointer"?
> > > > > 2) When a pointer or address is used as a non-lvalue,
is it > called
> > > an
> > > > > "address"?
> > > > >
> > > > > (This doesn't change the answer
> > > > >
> > > > > --
> > > > > Clark S. Cox, III
> > > > > cl*******@gmail.com
> > > > >
> > > >
> > > > I inferred from what he said not from what he meant to say. > > > >
> > > > Suppose we did have some function that returned a pointer
> > > > to some object, then the value it returns is the value of

that
> > > > expression.
> > > >
> > > > If we pass a pointer to some object to scanf, we also have > > > > a value of an expression in this context too. Whether this > > > > value is then used as an lvalue within scanf is irrelevant to > > > > what he asked.
> > > >
> > > > From this, he follows with the question of ``isn't an lvalue a
> > > pointer to''.
> > > > lvalues are in a completely different context from what
he was
> > > > previously talking about. lvalues designate objects! This
has > > > absolutely
> > > > nothing to do with values of expressions. As such, my

response
> stands
> > > > relevant to the question ``isn't an lvalue a pointer to''. It is
> not
> > > my
> > > > problem if he is incapable of expressing himself with the

English
> > > > language.
> > > >
> >
> > <snipped babbling>
>
> >
> > You went from talking about values of expressions and
> > why they may be referred to as ``pointer to..'' or ``an
address'' > > to asking ``isn't the lvalue a pointer to?''. Your first question > > had nothing to do with lvalues.
>
> You say my first question had nothing to do with lvalues. You're a > genius.
>
> > Which I have already explained.
> > You are asking a separate question about whether an lvalue
> > is a ``pointer to''. My counter-example showed that an lvalue
> > does not necessarily mean ``pointer to''. You can certainly
> > use a pointer to a valid object as an lvalue but this does not > > imply that all lvalues are a pointer to some object.
> >
>
> Why do you insist on adding proof to my claim that you're a high > calibre idiot?
> Your writing is horrible, and you sure as heck can't read.
>
> The first question in my post was: "Isn't the lvalue called a

POINTER
> TO and the (r)value called the ADDRESS OF?"
>
> Before that I had a paragraph that builds the context up before I > unleashed the question(and the title helped too). And even to let the
> marginally retarted like you know that the question was related
to > previous context, I used "the lvalue" instead of "a lvalue." That > "the" links that sentence strongly with the previous one, but even with
> an "a" there, an average idiot could have figured out the

connection.
> But as you've shown, you're no average idiot.
>
> In your most recent response (above), you say that my first

question
> had nothing to do with lvalues. So I wonder what the word
"lvalue" in
> the question was placed there for? Maybe I'm as dumb as you,
so I just
> plugged that word in for no reason, knowing that seasoned
veterans of
> idiocy will just ignore it.
>
> I can't believe you're still responding and increasing your
status as a
> top quality idiot.
>

To quote you,
``I'm just wondering why people/books/experts say "the function

returns a
pointer to.." or "we have to send scanf a pointer to.." instead
of "the
function returns the address of.." or "we have to send scanf the
address of.." '' ...

... is a question in itself. Even without an explicit question
mark. Which means that it is your initial question. So what is the problem?


The first sentence could be taken as a "call for a response," but

it's not a question. It could be considered "similar" to a "question" if it wasn't followed by an actual question that triggered the context that the first sentenced built up. Since I used a question to connect to the previous context, most people would not consider the first sentence as an independent "call for a response" (it's not a question period!).

In fact, observe the other responses to your initial post. This

question
was the first one addressed. :)

Why do you think that is?


What is your point? You responded to the actual first question, not the first sentence (go and check).

Oh, look at the inclusion of the word ``why'' near the start of that sentence.


What does this sentence mean to you? : "He wonders 'why' idiots don't stop."
Is that a question? It uses the word "why!!!"


Different context. I referred you to your initial question which
included ``why'' near the start of the sentence. You are making
an inquiry as to the reasoning behind calling ``addresses'',
``pointers''.
How about this sentence? : "It doesn't matter 'when' he'll understand he's an idiot, he's only out to prove supremacy in his field of
idiocy."
Is that a question? It uses the word "when!!!"


Different context.
What do you think that conveys to the reader?


Depends on whether or not the reader was a supreme idiot. Since I
didn't intend for my target audience to include idiots, most that
responded understood fine, except this one individual.


I think your excessive use of the word ``idiot'' makes youl ook

foolish. You aren't showing incontravertibly that, that is true. So it has no
bearing. :)

Additionally, your use of ``the lvalue'' is referring to the
concept here
not to anything relating to your initial question. Unless you can provide
reasoning as to how your initial question had anything to do with
an lvalue. I suspect that you cannot.


English is my 4th language, and let me guess, it must be your 10+th?
Irrelevant.
What are you talking about in the passage above? What do you mean
by "here." You're using the word "here" without any sort of proper
context for it built up, and you complain about my lack of clarity.


It was written in response to your post. The post I was responding
to serves as providing proper context. If I were to exclude your
post from my response, then I would not be providing proper
context.

I'm a mechanical engineer trying to learn the ins/outs of C.


I don't care.
Just
because you're more familiar with C than me, that doesn't give you the right to bash anything but my C skills (like my English).


Oh stop your bloody whinging. It is really off-topic for this

newsgroup. The main point here is that your initial question,

``I'm just wondering why people/books/experts say "the function returns a pointer to.." or "we have to send scanf a pointer to.." instead of "the function returns the address of.." or "we have to send scanf the
address of.." '' ...

... has absolutely nothing to do with lvalues. What part of that do you not understand? So relating your second question to the first in this regard, is absolutely meaningless. Try and answer this question again, since
you completely ignored it in your response. I asked you, to what lvalue were you referring to?

I'll make it extremely simple for you.

First question,
``I'm just wondering why people/books/experts say "the function returns a pointer to.." or "we have to send scanf a pointer to.." instead of "the function returns the address of.." or "we have to send scanf the
address of.." ''

Second question,
``Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?''

Where is the lvalue that you are referring to in the first question?
I see no such lvalue mentioned.


Ok guys, stop clogging up the internet with these posts (the backbone
routers are sweating).

As for the argument, I think you(j) totally misunderstood the original
post. I have no idea how you thought a sentence in the middle of the
post was unrelated to the subject at hand.

I was going to respond to the original post, but Chris Torek posted an
answer 10 times better than mine.

Nov 14 '05 #16
j

"Big K" <ki*********@gmail.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...

j wrote:
"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...

j wrote:
> "TTroy" <ti*****@gmail.com> wrote in message
> news:11*********************@z14g2000cwz.googlegro ups.com...
> >
> > j wrote:
> > > "TTroy" <ti*****@gmail.com> wrote in message
> > > news:11**********************@f14g2000cwb.googlegr oups.com...
> > > >
> > > > j wrote:
> > > > > "Clark S. Cox III" <cl*******@gmail.com> wrote in message
> > > > > news:2005013111564516807%clarkcox3@gmailcom...
> > > > > > On 2005-01-31 10:55:50 -0500, "j"
<ja**********@bellsouth.net>
> > > > said:
> > > > > >
> > > > > > >
> > > > > > > "TTroy" <ti*****@gmail.com> wrote in message
> > > > > > >
news:11**********************@f14g2000cwb.googlegr oups.com...
> > > > > > >>
> > > > > > >> j wrote:
> > > > > > >>> "TTroy" <ti*****@gmail.com> wrote in message
> > > > > > >>>
> > news:11**********************@f14g2000cwb.googlegr oups.com...
> > > > > > >>>> Hi,
> > > > > > >>>>
> > > > > > >>>> I'm just wondering why people/books/experts say "the > > function
> > > > > > >> returns a
> > > > > > >>>> pointer to.." or "we have to send scanf a pointer
to.."
> > > > instead of
> > > > > > >> "the
> > > > > > >>>> function returns the address of.." or "we have to send > > scanf
> > > > the
> > > > > > >>>> address of.."
> > > > > > >>
> > > > > > >> subject of post clearly established above
> > > > > > >>
> > > > > > >>>>
> > > > > > >>>> Isn't the lvalue called a POINTER TO and the (r)value > > called
> > > > the
> > > > > > >>>> ADDRESS OF?
> > > > > > >>
> > > > > > >> a question asked about the subject
> > > > > > >>
> > > > > > >>>>
> > > > > > >>>
> > > > > > >>> The value of an expression can be an address, yes. But just
> > > > what does
> > > > > > >>> that tell you about the type of the value?
> > > > > > >>>
> > > > > > >>> An lvalue is not necessarily a pointer. Consider the > > following,
> > > > > > >>>
> > > > > > >>> int foo;
> > > > > > >>>
> > > > > > >>> foo = 10;
> > > > > > >>>
> > > > > > >>> Is foo a pointer?
> > > > > > >>
> > > > > > >> totally unrelated question above
> > > > > > >>
> > > > > > >>>
> > > > > > >>> If you answered ``yes'', then I recommend you buy a
book on
> > C.
> > > > > > >>>
> > > > > > >>>
> > > > > > >>
> > > > > > >> The subject of my post was pointers to & addresses of. > > > > > > >> Why are you presenting me with a question about an int > > variable?
> > > > > > >> Several years ago I did read a book that told me that the
> > > > "context" of
> > > > > > >> a statement or sentence affects it's meaning. Have you read
> > any
> > > > > > >> similar books?
> > > > > > >>
> > > > > > >
> > > > > > > You are not good at this reading business are you?
> > > > > >
> > > > > > I think it may be you that needs to brush up on reading
> > > > comprehension.
> > > > > >
> > > > > > > The point of that was even though a pointer to an object > > > > > > > may be used as an lvalue, not all lvalues are a pointer > > > > > > > to an object. ``foo'' is an object with an object type of > > ``int''
> > > > > > > and is not a pointer to such an object.
> > > > > > >
> > > > > > > This answers your question ``Isn't the lvalue called a > > POINTER
> > > > TO''
> > > > > >
> > > > > > Again, you've totally missed the context that the OP
provided.
> > That
> > > > > > question was *only* withing the context of pointers and
> > addresses.
> > > > > > Though, of course, the answer turned out to be "no", your > > answer is
> > > > > > totally irrelevant.
> > > > > >
> > > > > > To help you understand the OP's question, you can break it into
> > the
> > > > > > following two questions:
> > > > > > 1) When a pointer or address is used as an lvalue, is it called
> > a
> > > > > "pointer"?
> > > > > > 2) When a pointer or address is used as a non-lvalue, is it > > called
> > > > an
> > > > > > "address"?
> > > > > >
> > > > > > (This doesn't change the answer
> > > > > >
> > > > > > --
> > > > > > Clark S. Cox, III
> > > > > > cl*******@gmail.com
> > > > > >
> > > > >
> > > > > I inferred from what he said not from what he meant to say. > > > > >
> > > > > Suppose we did have some function that returned a pointer
> > > > > to some object, then the value it returns is the value of
that
> > > > > expression.
> > > > >
> > > > > If we pass a pointer to some object to scanf, we also have > > > > > a value of an expression in this context too. Whether this > > > > > value is then used as an lvalue within scanf is irrelevant to > > > > > what he asked.
> > > > >
> > > > > From this, he follows with the question of ``isn't an lvalue a
> > > > pointer to''.
> > > > > lvalues are in a completely different context from what he was
> > > > > previously talking about. lvalues designate objects! This has > > > > absolutely
> > > > > nothing to do with values of expressions. As such, my
response
> > stands
> > > > > relevant to the question ``isn't an lvalue a pointer to''. It is
> > not
> > > > my
> > > > > problem if he is incapable of expressing himself with the
English
> > > > > language.
> > > > >
> > >
> > > <snipped babbling>
> >
> > >
> > > You went from talking about values of expressions and
> > > why they may be referred to as ``pointer to..'' or ``an address'' > > > to asking ``isn't the lvalue a pointer to?''. Your first question > > > had nothing to do with lvalues.
> >
> > You say my first question had nothing to do with lvalues. You're a > > genius.
> >
> > > Which I have already explained.
> > > You are asking a separate question about whether an lvalue
> > > is a ``pointer to''. My counter-example showed that an lvalue
> > > does not necessarily mean ``pointer to''. You can certainly
> > > use a pointer to a valid object as an lvalue but this does not > > > imply that all lvalues are a pointer to some object.
> > >
> >
> > Why do you insist on adding proof to my claim that you're a high > > calibre idiot?
> > Your writing is horrible, and you sure as heck can't read.
> >
> > The first question in my post was: "Isn't the lvalue called a
POINTER
> > TO and the (r)value called the ADDRESS OF?"
> >
> > Before that I had a paragraph that builds the context up before I > > unleashed the question(and the title helped too). And even to let the
> > marginally retarted like you know that the question was related to > > previous context, I used "the lvalue" instead of "a lvalue." That > > "the" links that sentence strongly with the previous one, but even with
> > an "a" there, an average idiot could have figured out the
connection.
> > But as you've shown, you're no average idiot.
> >
> > In your most recent response (above), you say that my first
question
> > had nothing to do with lvalues. So I wonder what the word "lvalue" in
> > the question was placed there for? Maybe I'm as dumb as you, so I just
> > plugged that word in for no reason, knowing that seasoned veterans of
> > idiocy will just ignore it.
> >
> > I can't believe you're still responding and increasing your status as a
> > top quality idiot.
> >
>
> To quote you,
> ``I'm just wondering why people/books/experts say "the function
returns a
> pointer to.." or "we have to send scanf a pointer to.." instead of "the
> function returns the address of.." or "we have to send scanf the
> address of.." '' ...
>
> ... is a question in itself. Even without an explicit question mark. > Which means that it is your initial question. So what is the problem? >

The first sentence could be taken as a "call for a response," but it's not a question. It could be considered "similar" to a "question" if it wasn't followed by an actual question that triggered the context that the first sentenced built up. Since I used a question to connect to the previous context, most people would not consider the first sentence as an independent "call for a response" (it's not a question period!).

>
> In fact, observe the other responses to your initial post. This
question
> was the first one addressed. :)
>
> Why do you think that is?

What is your point? You responded to the actual first question, not the first sentence (go and check).

>
> Oh, look at the inclusion of the word ``why'' near the start of that > sentence.

What does this sentence mean to you? : "He wonders 'why' idiots don't stop."
Is that a question? It uses the word "why!!!"


Different context. I referred you to your initial question which
included ``why'' near the start of the sentence. You are making
an inquiry as to the reasoning behind calling ``addresses'',
``pointers''.
How about this sentence? : "It doesn't matter 'when' he'll understand he's an idiot, he's only out to prove supremacy in his field of
idiocy."
Is that a question? It uses the word "when!!!"


Different context.
> What do you think that conveys to the reader?

Depends on whether or not the reader was a supreme idiot. Since I
didn't intend for my target audience to include idiots, most that
responded understood fine, except this one individual.


I think your excessive use of the word ``idiot'' makes youl ook

foolish.
You aren't showing incontravertibly that, that is true. So it has no
bearing. :)
>
> Additionally, your use of ``the lvalue'' is referring to the concept here
> not to anything relating to your initial question. Unless you can
provide
> reasoning as to how your initial question had anything to do with
> an lvalue. I suspect that you cannot.
>

English is my 4th language, and let me guess, it must be your 10+th?

Irrelevant.
What are you talking about in the passage above? What do you mean

by "here." You're using the word "here" without any sort of proper
context for it built up, and you complain about my lack of clarity.


It was written in response to your post. The post I was responding
to serves as providing proper context. If I were to exclude your
post from my response, then I would not be providing proper
context.

I'm a mechanical engineer trying to learn the ins/outs of C.


I don't care.
Just
because you're more familiar with C than me, that doesn't give you the right to bash anything but my C skills (like my English).


Oh stop your bloody whinging. It is really off-topic for this

newsgroup.
The main point here is that your initial question,

``I'm just wondering why people/books/experts say "the function

returns a
pointer to.." or "we have to send scanf a pointer to.." instead of

"the
function returns the address of.." or "we have to send scanf the
address of.." '' ...

... has absolutely nothing to do with lvalues. What part of that do

you not
understand? So relating your second question to the first in this

regard,
is absolutely meaningless. Try and answer this question again, since
you completely ignored it in your response. I asked you, to what

lvalue
were you referring to?

I'll make it extremely simple for you.

First question,
``I'm just wondering why people/books/experts say "the function

returns a
pointer to.." or "we have to send scanf a pointer to.." instead of

"the
function returns the address of.." or "we have to send scanf the
address of.." ''

Second question,
``Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?''

Where is the lvalue that you are referring to in the first question?
I see no such lvalue mentioned.


Ok guys, stop clogging up the internet with these posts (the backbone
routers are sweating).

As for the argument, I think you(j) totally misunderstood the original
post. I have no idea how you thought a sentence in the middle of the
post was unrelated to the subject at hand.

I was going to respond to the original post, but Chris Torek posted an
answer 10 times better than mine.


It is simple. What is the lvalue that he is referring to?

--
j
Nov 14 '05 #17
In article <2x*****************@bignews4.bellsouth.net>,
ja**********@bellsouth.net says...
I was going to respond to the original post, but Chris Torek posted an
answer 10 times better than mine.


It is simple. What is the lvalue that he is referring to?


How about learning how to snip for crying out loud?
Nov 14 '05 #18
TTroy wrote:
I'm just wondering why people/books/experts say
"the function returns a pointer to.." or
"we have to send scanf a pointer to.." instead of
"the function returns the address of.."
or "we have [must] address of.."

Isn't the lvalue called a POINTER TO
and the (r)value called the ADDRESS OF?

Why do people refer to the (r)values moving around in a program
as pointers?
(Am I missing something?
Or just reading too much into a non-issue?)
Probably.
[I've noticed that experts almost never say "address of",
but often time beginners do. There must be something to it]


Pointers are objects
and the values that they contain are addresses.
The representation of addresses is implementation dependent.
They may be [virtual] memory addresses.

int i = 0;
int* p = &i;

p is a pointer to an object of type int.
&i is the address of an object of type int.
void f(int* p);
f(p); // passes a pointer to f(int*)
f(&i) // passes an address to f(int*)

But, since p == &i, it might be correct to say either one.
Nov 14 '05 #19

"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I'm just wondering why people/books/experts say "the function returns a
pointer to.." or "we have to send scanf a pointer to.." instead of "the
function returns the address of.." or "we have to send scanf the
address of.."

Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?

Why do people refer to the (r)values moving around in a program as
pointers? (Am I missing something, or just reading too much into a
non-issue?)

[I've noticed that experts almost never say "address of", but often
time beginners do... there must be something to it]
A pointer is an object. An address is a value.
A pointer object can store the value of an address.
This address value becomes the pointer object's value.
People will use often 'pointer' and 'address' interchangeably,
but technically a function would return an 'address
value', which can be stored in a pointer type object.

-Mike

Nov 14 '05 #20
Will both of you please knock it off?

The OP asked:

Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?

(Yes, there was more context than that.) What the OP *meant* was to
ask whether an lvalue of pointer type is referred to as a "pointer",
and an rvalue of pointer type is referred to as an "address". (I
won't try to answer the question here.)

Given that meaning, and given the additional context, what the OP
wrote is, I think, a reasonable way to ask the question.

Given the way the question was phrased, it's not entirely unreasonable
to assume, mistakenly, that the OP meant that lvalues in general are
referred to as "pointers".

In fact, given a different set of terminology, that's not an entirely
unreasonable way to look at it. Given:

int foo;
foo = 42;

the expression "foo" in the assignment statement is an lvalue. You
can think of it as implicitly taking the address of foo; after all,
the machine needs to know where foo is to be able to assign a value to
it. This breaks down for two reasons: you can assign a value to a
"register" variable, which doesn't necessarily have an address, and
the C standard doesn't talk about it that way. In the abstract
machine defined by the C standard, taking the address of the target
isn't part of an assignment statement (even though it may happen on
the machine level). But you could easily define an abstract machine
in which it is, which makes it even easier to assume that that's what
the OP had in mind. I don't know (or much care) whether anyone in
this discussion thought of it that way.

This is a discussion group. Misunderstandings happen all the time.
The usual approach is to clarify what was meant and move on.

Endless cascades are frowned upon. It's usually appropriate to
provide some context, but it seldom makes sense to quote the entire
previous article.

If you want to call each other idiots, either for not writing clearly
or for not reading clearly, this is not the place for it. If you
don't want to talk about C, please talk somewhere else.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #21
"TTroy" <ti*****@gmail.com> writes:
I'm just wondering why people/books/experts say "the function returns a
pointer to.." or "we have to send scanf a pointer to.." instead of "the
function returns the address of.." or "we have to send scanf the
address of.."

Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?

Why do people refer to the (r)values moving around in a program as
pointers? (Am I missing something, or just reading too much into a
non-issue?)

[I've noticed that experts almost never say "address of", but often
time beginners do... there must be something to it]


If you want to be strict about it, you can say that a "pointer" is an
*object* of some pointer type, and an "address" is a *value* of some
pointer type. Both objects and values have types; in both cases, the
type is a "pointer type".

Most people, though, aren't that precise -- and in this particular
case, it's not a problem. We don't generally talk about "address
objects", but we do talk about "pointer values" (which might be more
properly called "address values"). In practice, the meaning is almost
always clear from the context. Just remember that if a function is
said to expect a pointer argument, that doesn't mean the argument has
to be an objectd; it can be any address expression of an appropriate
type.

Even the standard sometimes uses "pointer" and "address" almost
interchangeably. For example, in footnote 53 (C99 6.3.2.1), it says:

As a further example, if E is a unary expression that is a pointer
to an object, *E is an lvalue that designates the object to which
E points.

It probably should refer to the expression as the address of an
object, but the meaning is clear.

In my opinion, it's not worth worrying about.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #22
j

"Keith Thompson" <ks***@mib.org> wrote in message
news:ln************@nuthaus.mib.org...
Will both of you please knock it off?

The OP asked:

Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?

(Yes, there was more context than that.) What the OP *meant* was to
ask whether an lvalue of pointer type is referred to as a "pointer",
and an rvalue of pointer type is referred to as an "address". (I
won't try to answer the question here.)
As I have stated elsewhere in the thread, don't expect people to discern
what you meant to say from what you actually said. In fact, the original
poster has already stated that the object of his second question, the
``lvalue'' was referring to his first question. However, his first question
contains no use of an lvalue. That is, an entity used to designate
an object to store some value. So it is bankrupt from the start.

Given that meaning, and given the additional context, what the OP
wrote is, I think, a reasonable way to ask the question.

I disagree. His second question, according to him, was referring back
to his initial question. So the usage of ``the lvalue'' in the second
question
to refer back to the initial question that did not contain any use of an
lvalue,
is utterly meaningless. In fact, I gave the OP the benefit of the doubt and
interpreted his second question as referring to ``lvalue the concept''.
Being that I saw no use of an lvalue in his initial question.
Given the way the question was phrased, it's not entirely unreasonable
to assume, mistakenly, that the OP meant that lvalues in general are
referred to as "pointers".
Like I said, I gave him the benefit of the doubt. His claim that his
second question involving the usage ``the lvalue'' was referring to
the first question -- which unfortunately for him, did not contain the
use of an lvalue -- is really bankrupt. That is, there was no such
expression involing the designation of an object to store some
value in.

In fact, given a different set of terminology, that's not an entirely
unreasonable way to look at it. Given:

int foo;
foo = 42;

the expression "foo" in the assignment statement is an lvalue. You
can think of it as implicitly taking the address of foo; after all,
the machine needs to know where foo is to be able to assign a value to
it. This breaks down for two reasons: you can assign a value to a
"register" variable, which doesn't necessarily have an address, and
the C standard doesn't talk about it that way. In the abstract
machine defined by the C standard, taking the address of the target
isn't part of an assignment statement (even though it may happen on
the machine level). But you could easily define an abstract machine
in which it is, which makes it even easier to assume that that's what
the OP had in mind. I don't know (or much care) whether anyone in
this discussion thought of it that way.

Good.
This is a discussion group. Misunderstandings happen all the time.
The usual approach is to clarify what was meant and move on.
I have pointed out the error. It is not difficult to comprehend.

Endless cascades are frowned upon. It's usually appropriate to
provide some context, but it seldom makes sense to quote the entire
previous article.

If you want to call each other idiots, either for not writing clearly
or for not reading clearly, this is not the place for it.


I have not called him an idiot once. I suggested that he
looks ``foolish'' for using the word ``idiot'' excessively.

And this has absolutely nothing to do with not reading clearly.
Which I have demonstrably shown elsewhere in the thread.

It has everything to do with not using an lvalue with respect
to his initial question but insisting that his second question
had some relevancy in regards to an lvalue being used in
his first question.

--
j
Nov 14 '05 #23
j

"Keith Thompson" <ks***@mib.org> wrote in message
news:ln************@nuthaus.mib.org...
Will both of you please knock it off?

The OP asked:

Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?

(Yes, there was more context than that.) What the OP *meant* was to
ask whether an lvalue of pointer type is referred to as a "pointer",
and an rvalue of pointer type is referred to as an "address". (I
won't try to answer the question here.)
As I have stated elsewhere in the thread, don't expect people to discern
what you meant to say from what you actually said. In fact, the original
poster has already stated that the object of his second question, the
``lvalue'' was referring to his first question. However, his first question
contains no use of an lvalue. That is, an entity used to designate
an object to store some value. So it is bankrupt from the start.

Given that meaning, and given the additional context, what the OP
wrote is, I think, a reasonable way to ask the question.

I disagree. His second question, according to him, was referring back
to his initial question. So the usage of ``the lvalue'' in the second
question to refer back to the initial question that did not contain any
use of an lvalue, is utterly meaningless. In fact, I gave the OP the
benefit of the doubt and interpreted his second question as referring
to ``lvalue the concept''. Being that I saw no use of an lvalue in his
initial question.
Given the way the question was phrased, it's not entirely unreasonable
to assume, mistakenly, that the OP meant that lvalues in general are
referred to as "pointers".
Like I said, I gave him the benefit of the doubt. His claim that his
second question involving the usage ``the lvalue'' was referring to
the first question -- which unfortunately for him, did not contain the
use of an lvalue -- is really bankrupt. That is, there was no such
expression involing the designation of an object to store some
value in.

In fact, given a different set of terminology, that's not an entirely
unreasonable way to look at it. Given:

int foo;
foo = 42;

the expression "foo" in the assignment statement is an lvalue. You
can think of it as implicitly taking the address of foo; after all,
the machine needs to know where foo is to be able to assign a value to
it. This breaks down for two reasons: you can assign a value to a
"register" variable, which doesn't necessarily have an address, and
the C standard doesn't talk about it that way. In the abstract
machine defined by the C standard, taking the address of the target
isn't part of an assignment statement (even though it may happen on
the machine level). But you could easily define an abstract machine
in which it is, which makes it even easier to assume that that's what
the OP had in mind. I don't know (or much care) whether anyone in
this discussion thought of it that way.

Good.
This is a discussion group. Misunderstandings happen all the time.
The usual approach is to clarify what was meant and move on.
I have pointed out the error. It is not difficult to comprehend.

Endless cascades are frowned upon. It's usually appropriate to
provide some context, but it seldom makes sense to quote the entire
previous article.

If you want to call each other idiots, either for not writing clearly
or for not reading clearly, this is not the place for it.


I have not called him an idiot once. I suggested that he
looks ``foolish'' for using the word ``idiot'' excessively.

And this has absolutely nothing to do with not reading clearly.
Which I have demonstrably shown elsewhere in the thread.

It has everything to do with not using an lvalue with respect
to his initial question but insisting that his second question
had some relevancy in regards to an lvalue being used in
his first question.

--
j
Nov 14 '05 #24

j wrote:

And this has absolutely nothing to do with not reading clearly.
Which I have demonstrably shown elsewhere in the thread.

It has everything to do with not using an lvalue with respect
to his initial question but insisting that his second question
had some relevancy in regards to an lvalue being used in
his first question.


I understood what the OP was asking perfectly. I guess you're the only
smart one who roams c.l.c. I don't think newbies like it when they're
told "if you don't understand, buy a book on C," especially when it was
the responder who didn't understand. I always hated those remarks!

Still, retaliating with all the "idiot" remarks wasn't exactly
respectful either.

Nov 14 '05 #25
Sniper1 wrote:
ja**********@bellsouth.net says...
I was going to respond to the original post, but Chris Torek
posted an answer 10 times better than mine.


It is simple. What is the lvalue that he is referring to?


How about learning how to snip for crying out loud?


At last - a voice of sanity.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
Nov 14 '05 #26

TTroy wrote:
Hi,

I'm just wondering why people/books/experts say "the function returns a pointer to.." or "we have to send scanf a pointer to.." instead of "the function returns the address of.." or "we have to send scanf the
address of.."

"Pointer" is a more generic term. A pointer can be an address, or an
address + an offset, or an array index, or something else entirely.
*Ususally*, pointers in C correspond to an address value, but they
don't need to.
Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?

I think you're conflating two different concepts. It is true that an
address expression such as &a is never an lvalue (i.e., you can't write
&a = something), whereas an indirection expression may be an lvalue (*p
= &a). Remember that an lvalue is an expression that refers to a chunk
of memory such that the memory may be read or written to, and an rvalue
is any expression that isn't an lvalue.
Why do people refer to the (r)values moving around in a program as
pointers? (Am I missing something, or just reading too much into a
non-issue?)
I'm not sure what you mean by "rvalues moving around in a program".
Any object that has type "pointer to T" is referred to as a pointer,
regardless of whether it's an lvalue or not.

[I've noticed that experts almost never say "address of", but often
time beginners do... there must be something to it]

Again, because a pointer isn't necessarily an address value.

Nov 14 '05 #27
Mike Wahler wrote:
"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I'm just wondering why people/books/experts say "the function returns a
pointer to.." or "we have to send scanf a pointer to.." instead of "the
function returns the address of.." or "we have to send scanf the
address of.."

Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?

Why do people refer to the (r)values moving around in a program as
pointers? (Am I missing something, or just reading too much into a
non-issue?)

[I've noticed that experts almost never say "address of", but often
time beginners do... there must be something to it]

A pointer is an object. An address is a value.
A pointer object can store the value of an address.
This address value becomes the pointer object's value.
People will use often 'pointer' and 'address' interchangeably,
but technically a function would return an 'address
value', which can be stored in a pointer type object.

-Mike


You are completely right here. Don't let anybody talk you out of it.
--
Joe Wright mailto:jo********@comcast.net
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Nov 14 '05 #28
jo*******@my-deja.com writes:
[...]
I'm not sure what you mean by "rvalues moving around in a program".
Any object that has type "pointer to T" is referred to as a pointer,
regardless of whether it's an lvalue or not.


The name of any object is an lvalue. (This isn't clear from the
standard's broken definition of "lvalue", but it's the intent.)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #29
On Mon, 31 Jan 2005 16:27:01 +0100, "dandelion" <da*******@meadow.net>
wrote in comp.lang.c:

"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I'm just wondering why people/books/experts say "the function returns a
pointer to.." or "we have to send scanf a pointer to.." instead of "the
function returns the address of.." or "we have to send scanf the
address of.."


AFAIK "pointer" is a logical construct, which is usually (in C) resolved
into an adress. For most C compilers the two terms are equivalent, but this
is not always the case. Specifically all kinds of segment constructions can
fuzzify the issue.


No, a pointer is an object. It can contain an address. The two terms
are not equivalent at all. Any more than double, which is an object,
is identical with a floating point value, which it can contain.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 14 '05 #30
On Mon, 31 Jan 2005 21:51:23 GMT, Keith Thompson <ks***@mib.org> wrote
in comp.lang.c:
"TTroy" <ti*****@gmail.com> writes:
I'm just wondering why people/books/experts say "the function returns a
pointer to.." or "we have to send scanf a pointer to.." instead of "the
function returns the address of.." or "we have to send scanf the
address of.."

Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?

Why do people refer to the (r)values moving around in a program as
pointers? (Am I missing something, or just reading too much into a
non-issue?)

[I've noticed that experts almost never say "address of", but often
time beginners do... there must be something to it]


If you want to be strict about it, you can say that a "pointer" is an
*object* of some pointer type, and an "address" is a *value* of some
pointer type. Both objects and values have types; in both cases, the
type is a "pointer type".

Most people, though, aren't that precise -- and in this particular
case, it's not a problem. We don't generally talk about "address
objects", but we do talk about "pointer values" (which might be more
properly called "address values"). In practice, the meaning is almost
always clear from the context. Just remember that if a function is
said to expect a pointer argument, that doesn't mean the argument has
to be an objectd; it can be any address expression of an appropriate
type.

Even the standard sometimes uses "pointer" and "address" almost
interchangeably. For example, in footnote 53 (C99 6.3.2.1), it says:

As a further example, if E is a unary expression that is a pointer
to an object, *E is an lvalue that designates the object to which
E points.

It probably should refer to the expression as the address of an
object, but the meaning is clear.


Actually, no, the wording of the footnote is exactly correct.

Paragraph 3 of 6.5.3.2 Address and indirection operators:

"3 The unary & operator returns the address of its operand. If the
operand has type ‘‘type’’, the result has type ‘‘pointer to type’’."

An "address" is not a defined type in C, it is a sort of "magic
cookie". Nowhere in the standard is the term "address" defined. An
address is only accessed by use of the '&' (address) operator, but
that operator yields a pointer that somehow relates to the "magic
cookie" of the address itself.

The only information the standard actually provides about this
mysterious address is that every function and every object not defined
with register storage type has one.

You can't do anything with an address other than create a pointer.
Addresses are not visible to a C program, only pointers created by
taking an address.

It's a subtle distinction.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 14 '05 #31
Mike Wahler wrote:

"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I'm just wondering why people/books/experts say "the function returns a
pointer to.." or "we have to send scanf a pointer to.." instead of "the
function returns the address of.." or "we have to send scanf the
address of.."

Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?

Why do people refer to the (r)values moving around in a program as
pointers? (Am I missing something, or just reading too much into a
non-issue?)

[I've noticed that experts almost never say "address of", but often
time beginners do... there must be something to it]


A pointer is an object.


Is NULL a pointer? Is it an object?

Given: char *p = "foo"; is p + 3 a pointer? Is it an object?

Is strcmp a pointer? Is it an object?
Nov 14 '05 #32
infobahn wrote:

[ ... ]
Is NULL a pointer? Is it an object?
NULL is a macro that expands to 0 in some implementation-defined
fashion -- it will usually 0, or 0L, or ((void *)0), but in some
particularly perverse implementation, could be something stupid like
('2' - ('1' + '1')). In any case, it has to be an integer constant
expression with the value 0.
Given: char *p = "foo"; is p + 3 a pointer? Is it an object?
'p+3' is the address of a NUL byte. It is not an object, but it is a
value that could be assigned to an object.
Is strcmp a pointer? Is it an object?


The standard library contains a function named strcmp, and could
conceivably contain a macro by the same name as well. If 'strcmp' is
evaluated in a program (by itself) it will evaluate to the address of
that function. A function is not an object, but (like the address
above) the address of a function is a value that could be assigned to
an object of the correct type (the correct type in this case being
"pointer to function").

--
Later,
Jerry.

The universe is a figment of its own imagination.

Nov 14 '05 #33
jc*****@taeus.com wrote:

infobahn wrote:

[ ... ]
Is NULL a pointer? Is it an object?


NULL is a macro that expands to 0 in some implementation-defined
fashion -- it will usually 0, or 0L, or ((void *)0), but in some
particularly perverse implementation, could be something stupid like
('2' - ('1' + '1')). In any case, it has to be an integer constant
expression with the value 0.


I presume you agree that NULL is not an object, then. Now let's
look at the Standard.

Firstly, NULL (a little whitespace has been elided):

The macros are NULL which expands to an implementation-defined null
pointer constant"

Okay, now "null pointer constant":

"An integral constant expression with the value 0, or such an
expression cast to type void * , is called a null pointer constant."

If NULL is not a pointer, then a null pointer constant is not a pointer.
Weird.

So either the claim that a pointer is an object is false, or NULL
is an object, or a null pointer constant is not a pointer.

Which of the three do you consider most likely?
Nov 14 '05 #34

"infobahn" <in******@btinternet.com> wrote in message
news:41***************@btinternet.com...
Mike Wahler wrote:

"TTroy" <ti*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I'm just wondering why people/books/experts say "the function returns a pointer to.." or "we have to send scanf a pointer to.." instead of "the function returns the address of.." or "we have to send scanf the
address of.."

Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?

Why do people refer to the (r)values moving around in a program as
pointers? (Am I missing something, or just reading too much into a
non-issue?)

[I've noticed that experts almost never say "address of", but often
time beginners do... there must be something to it]
A pointer is an object.


Is NULL a pointer? Is it an object?


Neither. It's the null pointer constant, specifically defined
by the langauge standard.

Given: char *p = "foo"; is p + 3 a pointer? Is it an object?
Neither. It's an expression whose value is an address.
The expression has a pointer type.

Is strcmp a pointer? Is it an object?


Neither. It's a function.

-Mike
Nov 14 '05 #35

"infobahn" <in******@btinternet.com> wrote in message
news:41***************@btinternet.com...
jc*****@taeus.com wrote:

infobahn wrote:

[ ... ]
Is NULL a pointer? Is it an object?
NULL is a macro that expands to 0 in some implementation-defined
fashion -- it will usually 0, or 0L, or ((void *)0), but in some
particularly perverse implementation, could be something stupid like
('2' - ('1' + '1')). In any case, it has to be an integer constant
expression with the value 0.


I presume you agree that NULL is not an object, then. Now let's
look at the Standard.

Firstly, NULL (a little whitespace has been elided):

The macros are NULL which expands to an implementation-defined null
pointer constant"

Okay, now "null pointer constant":

"An integral constant expression with the value 0, or such an
expression cast to type void * , is called a null pointer constant."

If NULL is not a pointer, then a null pointer constant is not a pointer.
Weird.


Not at all. A constant is not an object. However an
object can store the value of a constant.

So either the claim that a pointer is an object is false, or NULL
is an object, or a null pointer constant is not a pointer.

Which of the three do you consider most likely?


The third (not just likely, but a fact).

-Mike
Nov 14 '05 #36
In article <41***************@btinternet.com>
infobahn <in******@btinternet.com> wrote:
... "null pointer constant":

"An integral constant expression with the value 0, or such an
expression cast to type void * , is called a null pointer constant."

If NULL is not a pointer, then a null pointer constant is not a pointer.
Weird.


Indeed, one of the two valid forms of null pointer constant is not
a pointer (or more precisely, not "a value of type pointer to T,
for some valid type T"). Instead, it is a value of some integral
type -- most likely "int", but perhaps "long" or similar. (Its
value is zero, or more precisely, "an int 0" or "a long 0" or
whatever.) The other form is -- it is a value of type "pointer to
void". (Its value is hard to describe, other than using the rather
vague / self-referential phrase, "a null pointer". All that the
C standard says about it is that it will compare unequal to the
address of any object or function, after appropriate type-conversions.
If the linker computes "&__impl_unused_byte" at link time, and
fills that in -- with any conversions required as well, of course
-- for all the null pointers, the actual machine-level address used
for NULL will depend on where that byte winds up in the executable!
This is quite different from the usual concrete implementation, in
which "machine address 0" or "machine address -1" is used.)

This is particularly confusing when the null pointer constant is
not a pointer at all, but is used to create null pointers:

int *p = 0;

sets p to whatever value is used for "null of type pointer to int"
(despite the lack of a cast).

Note also that there is nothing forcing an implementation to use only
one single "null pointer": the "null of type pointer to int" machine-
level address might be &__impl_null_int, while the "null of type
pointer to char" machine-level address might be &__impl_null_char.
An implementation that did this would, however, probably have to
do something to make:

char *q = (char *)p;
if (q == NULL) ...

"work right". (I think that the C standard claims that all null
pointers compare equal, when suitably converted, but I would have to
double-check, and it is late... :-) )
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
Nov 14 '05 #37
infobahn <in******@btinternet.com> writes:
[...]
Okay, now "null pointer constant":

"An integral constant expression with the value 0, or such an
expression cast to type void * , is called a null pointer constant."

If NULL is not a pointer, then a null pointer constant is not a pointer.
Weird.


A null pointer constant is not a pointer; it's a source code construct.
Pointers exist only during program execution.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #38
Keith Thompson wrote:

infobahn <in******@btinternet.com> writes:
[...]
Okay, now "null pointer constant":

"An integral constant expression with the value 0, or such an
expression cast to type void * , is called a null pointer constant."

If NULL is not a pointer, then a null pointer constant is not a pointer.
Weird.


A null pointer constant is not a pointer; it's a source code construct.
Pointers exist only during program execution.


Okay, let's try another tack.

The Standard says: "The result of the unary & (address-of) operator
is a pointer to the object or function designated by its operand."

So &object is a pointer. Is it your contention that &object is
itself an object?
Nov 14 '05 #39
infobahn <in******@btinternet.com> writes:
[...]
Okay, let's try another tack.

The Standard says: "The result of the unary & (address-of) operator
is a pointer to the object or function designated by its operand."

So &object is a pointer. Is it your contention that &object is
itself an object?


Certainly not.

That wording is from the C90 standard. C99 6.5.3.2p3 says:
"The unary & operator returns the address of its operand."

In my opinion, the wording in the C90 standard was imprecise, and the
C99 wording is an improvement.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #40
Jack Klein wrote:
On Mon, 31 Jan 2005 16:27:01 +0100, "dandelion" <da*******@meadow.net>
wrote in comp.lang.c:

AFAIK "pointer" is a logical construct, which is usually (in C) resolved
into an adress. For most C compilers the two terms are equivalent, but this
is not always the case. Specifically all kinds of segment constructions can
fuzzify the issue.

No, a pointer is an object. It can contain an address.


And this address is sometimes called a pointer. Yes, even by
the standard.

Really though, pointers are types. The same goes for all types T,
you can have variables of type T and values of type T. Nothing
special about pointers there. The & operator for example returns
a value with type pointer to T.

And the standard is pretty clear that this:

int *func(void);

declares a function which returns _a pointer_. Clearly there is no
object being returned, just a value.

--
Thomas.
Nov 14 '05 #41
Mike Wahler wrote:
"infobahn" <in******@btinternet.com> wrote in message
news:41***************@btinternet.com..
So either the claim that a pointer is an object is false, or NULL
is an object, or a null pointer constant is not a pointer.

Which of the three do you consider most likely?

The third (not just likely, but a fact).


The standard disagrees with you, hmm, strange. Something is
not factual here.

In the wider sense at least. Null pointer constants might not
be pointers, but there is at least something called null
pointers which are returned by functions. Cause the standard
says so.

Clearly if we have p, which is a variable of type T* and n
which is an int type then p + n is a pointer.

If you disagree with that then you disagree that the expressions
(n) is an int. Because if you want to make the distinctions between
pointer variables and the values they hold then one should make the
distinction between int variables and the values they hold. I see
no reason to treat them differently at least.

--
Thomas.
Nov 14 '05 #42

"Thomas Stegen" <th***********@gmail.com> wrote in message
news:36*************@individual.net...
Mike Wahler wrote:
"infobahn" <in******@btinternet.com> wrote in message
news:41***************@btinternet.com..
So either the claim that a pointer is an object is false, or NULL
is an object, or a null pointer constant is not a pointer.

Which of the three do you consider most likely?

The third (not just likely, but a fact).


The standard disagrees with you, hmm, strange. Something is
not factual here.

In the wider sense at least. Null pointer constants might not
be pointers, but there is at least something called null
pointers which are returned by functions. Cause the standard
says so.


'null pointer constant' and 'null pointer' are distinct
concepts.

Clearly if we have p, which is a variable of type T* and n
which is an int type then p + n is a pointer.
It's an expression which has a pointer type. It's not
an object. A pointer is an object.

If you disagree with that then you disagree that the expressions
(n) is an int.
It's not. Expressions are not objects.

Because if you want to make the distinctions between
pointer variables and the values they hold then one should make the
distinction between int variables and the values they hold.
I do.
I see
no reason to treat them differently at least.


There is a distinction between an object and an expression.

-Mike
Nov 14 '05 #43
Mike Wahler wrote:
"Thomas Stegen" <th***********@gmail.com> wrote in message
news:36*************@individual.net...
In the wider sense at least. Null pointer constants might not
be pointers, but there is at least something called null
pointers which are returned by functions. Cause the standard
says so.

'null pointer constant' and 'null pointer' are distinct
concepts.


Which is what I allude to above when I say: "Null pointer constants
might not be pointers".

I am not sure I agree to the fact that null pointer constants
are not pointers though.
Clearly if we have p, which is a variable of type T* and n
which is an int type then p + n is a pointer.

It's an expression which has a pointer type. It's not
an object.


That much no one disagrees with.
A pointer is an object.

True, but can it also be a value? Look at the description of
malloc for example: It returns a pointer.

"The malloc function returns either a null pointer or a pointer to the
allocated space."

So either the standard is wrong and malloc does not return a pointer,
or you are wrong and expressions can be pointers.

So if you are saying that only objects can be pointers I would like
to see chapter and verse please. Especially in the light of the fact
that object do not have types except when evaluated for their value.
(And then they _may_ be regarded as being of a particular type.)
IOW, talking about an object being and int or a pointer seems informal
in the first place.

Now, I have no problem seeing why some want to say that only objects
can be pointers. I only contend the claim that this is anything other
than an informal colloquioal distinction.

If you disagree with that then you disagree that the expressions
(n) is an int.

It's not. Expressions are not objects.


It's not an object, that much is clear. Only an idiot (or a newbie)
could think that it is. But still, the standard talks about functions
returning ints. So if you want to say that expression cannot evaluate
to int then I want to see chapter and verse.

Because if you want to make the distinctions between
pointer variables and the values they hold then one should make the
distinction between int variables and the values they hold.

I do.

I see
no reason to treat them differently at least.

There is a distinction between an object and an expression.


That's irrelevant here though. The disctinction was between
different types, not object versus expression. (For my very
last statement.)

And the overall discussion is not expression versus object either,
it is whether an expression can be something (in this case a pointer).

--
Thomas.
Nov 14 '05 #44
Thomas Stegen <th***********@gmail.com> writes:
Mike Wahler wrote:
"Thomas Stegen" <th***********@gmail.com> wrote in message
news:36*************@individual.net...
In the wider sense at least. Null pointer constants might not
be pointers, but there is at least something called null
pointers which are returned by functions. Cause the standard
says so.

'null pointer constant' and 'null pointer' are distinct
concepts.


Which is what I allude to above when I say: "Null pointer constants
might not be pointers".

I am not sure I agree to the fact that null pointer constants
are not pointers though.


Null pointer constants are not pointers; they're constants.

A pointer is an entity that exists during execution of a program.
A null pointer constant is a construct that exists in the program
source. It has no more existence during program execution than a
comment does (though it may result in the creation of an execution
time pointer value).

[...]
True, but can it also be a value? Look at the description of
malloc for example: It returns a pointer.

"The malloc function returns either a null pointer or a pointer to the
allocated space."
[...]
Now, I have no problem seeing why some want to say that only objects
can be pointers. I only contend the claim that this is anything other
than an informal colloquioal distinction.


Agreed, the standard uses the term "pointer" to refer either to a
pointer value or to a pointer object. But this is separate from the
issue of null pointer constants.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #45
TTroy wrote:
[I've noticed that experts almost never say "address of", but often
time beginners do... there must be something to it]


Besides address values,
pointers are also capable of have a value of NULL,
which is not an adddress.

--
pete
Nov 14 '05 #46

TTroy wrote:
Hi,

I'm just wondering why people/books/experts say "the function returns a pointer to.." or "we have to send scanf a pointer to.." instead of "the function returns the address of.." or "we have to send scanf the
address of.."

Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?

Why do people refer to the (r)values moving around in a program as
pointers? (Am I missing something, or just reading too much into a
non-issue?)

[I've noticed that experts almost never say "address of", but often
time beginners do... there must be something to it]

consider the following (which leads to a simple answer):

int i, *ptr_i;

ptr_i = &i;

the & address of operator always returns a value, so &i is a value that
represents the address of i and is of TYPE=pointer-to-int.

the left side of an = statement is always an lvalue, so ptr_i an lvalue
designating an object of TYPE=pointer-to-int

So both addresses(values) and the pointer variables that hold
them(objects) have TYPES that are pointer-to-something. The addresses
are pointer values, the objects are pointer objects.

So when someone says __________ is a "pointer", it simply either a
pointer value or a pointer object, as determined by the context.

So it isn't incorrect to say "malloc returns a pointer," because we
know that functions only return values, so the 'pointer' the above
sentence refers to is actually a 'pointer value' (where pointer values
are addresses of the objects pointed to).

Also it isn't incorrect to say that "we have to assign the address to a
pointer," because we know that only lvalues/objects can be assigned to,
so 'pointer' in this case refers to a 'pointer object.'

So it's simple, "pointer" is a general term that can refer to either a
"pointer object" or a "pointer value" depending on context.

Nov 14 '05 #47

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

Similar topics

388
by: maniac | last post by:
Hey guys, I'm new here, just a simple question. I'm learning to Program in C, and I was recommended a book called, "Mastering C Pointers", just asking if any of you have read it, and if it's...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.