Re: Problem with array objects
"Joshua Maurice" <joshuamaurice@gmail.com> wrote in message
news:7e86a2a6-f520-4e95-8e17-1586e0ba701c@v11g2000prk.googlegroups.com...
On Jun 3, 2:14 am, "Alf P. Steinbach /Usenet" <alf.p.steinbach
+use...@gmail.com> wrote:
* Pete Becker, on 03.06.2011 04:06:
Which is what I said above: an int* points to an int. It does not point
to an
array of int objects, because an array of int objects is not an int.
It's just a question of terminology, common sense & effective
communication.
If you want I can cite you umpteen examples from the standard that employ
far
worse terminological shortcuts.
Intelligent folks don't write to you requiring that you do editorial fixes
of
those places, because to anyone with half a mind it's obvious what's
meant.
---
So, why not leave Paul's favorite TROLLING question alone? It was quiet
for a
while here. Then Ian Collins and you started responding to Paul again.
Argh.
Please keep in mind: many of us have much invested in using particular
software
such as Thunderbird, and can't easily switch to newsreaders with general
scoring.
Cheers, & exasperated,
--Heh. I'm basically done with Paul, short of a one liner reply if he
--makes a new thread on this subject (or exactly where member functions
--"live"). As I've said, my recent posting has been because I finally
--saw what he's arguing, and that gave me a little hope.
--I'm personally a little annoyed that the other people arguing against
--him are almost arguing non-sequiturs, and not arguing what really
--matters, despite my explanations thereof. You need to convince Paul
--that the object of array type is the same thing as the array object is
--the same thing as the array type object, and the elements of the array
--are sub-objects of the array object and are contained within the
--memory of the array object. You also need to convince Paul that a
--reasonable person will interpret "X is a pointer to int" as a claim
--about the static type of X, not as a claim about the runtime value of
--X.
Using the term "a pointer to X" to refer to the type of the pointer is loose
use of english language and is shorthand for saying "is a pointer of type
ptr-to-X".
The term "is a pointer to" is more commonly used as an indiciation of what
is pointed to , not the type of the pointer.
-- And everyone needs to drop this annoying argument that "int* x;"
--cannot point to an array and can only point at int objects (contrast
--"is a pointer to int") - that's simply not how most people use the
--terminology. Ex:
-- class A {};
-- class B : public A {};
-- B b;
-- A* a = &b;
--Most people would not bat an eye at saying "a points at b", even
--though by this absurd pedantic argument in this thread against Paul,
--one would conclude that "a does not point at b; a only points at the
--sub-object of type A contained in b".
Well you are beginning to see sense.
But the old polymorphic argument will not convince the die hards, I've
already tried that one :)
When we access an array the pointer expression can be shown as:
*(p + i);
In this expression.. 'p' is a pointer to the beginning of the array and 'i'
is an offset that indexes the individual elements.