delete[] p or delete[] *p

G

Goran

Eh!? No, you presented no evidence. You __misinterpreted__ an
interview and a part of the standard.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
No I quoted some text from websites, no interview misquotations.

Quotes are correct, your __interpretation__ is wrong.
the standard clearly states that
pointer representation of arrays are (n-1) dimensional.

Standard does no such thing. not. You made a leap from "array of
dimension n, when it appears in an expression, is __converted__ to a
pointer to an array of the dimension n-1. The opposite is not true,
and standard does not say that. You are misinterpreting that passage.

Goran.
 
P

Paul

Eh!? No, you presented no evidence. You __misinterpreted__ an
interview and a part of the standard.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
No I quoted some text from websites, no interview misquotations.

Quotes are correct, your __interpretation__ is wrong.
the standard clearly states that
pointer representation of arrays are (n-1) dimensional.

Standard does no such thing. not. You made a leap from "array of
dimension n, when it appears in an expression, is __converted__ to a
pointer to an array of the dimension n-1. The opposite is not true,
and standard does not say that. You are misinterpreting that passage.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Yes so if we convert an array to a pointer , the resulting pointer is a
pointer to an (n-1) dim array.
So now we have a pointer to the array, the pointer-type just happens to be
type pointer to (n-1) dim array.
 
G

Goran

Standard does no such thing. not. You made a leap from "array of
dimension n, when it appears in an expression, is __converted__ to a
pointer to an array of the dimension n-1. The opposite is not true,
and standard does not say that. You are misinterpreting that passage.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Yes so if we convert an array to a pointer , the resulting pointer is a
pointer to an (n-1) dim array.
So now we have a pointer to the array, the pointer-type just happens to be
type pointer to (n-1) dim array.

The pointer-type says what the pointer __is__. When dereferenced, it
will give you a reference to the first element of the array. When
incremented, it will give you next element of the array. When indexed,
it will index inside the array. It __never__ points to the array, only
to it's elements, first or otherwise.

It walks like a duck, it quacks like a duck, it __is__ a duck.

Now go huff and puff some more, I see you like that. And it amuses me,
too.

Goran.
 
P

Paul

Standard does no such thing. not. You made a leap from "array of
dimension n, when it appears in an expression, is __converted__ to a
pointer to an array of the dimension n-1. The opposite is not true,
and standard does not say that. You are misinterpreting that passage.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Yes so if we convert an array to a pointer , the resulting pointer is a
pointer to an (n-1) dim array.
So now we have a pointer to the array, the pointer-type just happens to be
type pointer to (n-1) dim array.

The pointer-type says what the pointer __is__. When dereferenced, it
will give you a reference to the first element of the array. When
incremented, it will give you next element of the array. When indexed,
it will index inside the array. It __never__ points to the array, only
to it's elements, first or otherwise.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
From the C standard this is the definition of a ponter-type:
"A pointer type describes an object whose value provides a reference to an
entity of the referenced type."

This is only part of the definiton, the whole definition is publicly
available in the C standard, and I am not trying to hide anything I am
quoting the part I think is releveant.

The value of a pointer provides a reference to an entity, of the referenced
type.

For a pointer to reference and array of T's, it must be type T*. T is the
referenced type not T[Size].

A pointer to T[Size], such as T (*p)[Size], does not reference the array, it
referneces an array-type, which is a different object than the array. It is,
under the hood, another pointer object, it does not reference THE ARRAY of
T's, it references a different array-type object.
 
G

Goran

Standard does no such thing. not. You made a leap from "array of
dimension n, when it appears in an expression, is __converted__ to a
pointer to an array of the dimension n-1. The opposite is not true,
and standard does not say that. You are misinterpreting that passage.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Yes so if we convert an array to a pointer , the resulting pointer is a
pointer to an (n-1) dim array.
So now we have a pointer to the array, the pointer-type just happens tobe
type pointer to (n-1) dim array.

The pointer-type says what the pointer __is__. When dereferenced, it
will give you a reference to the first element of the array. When
incremented, it will give you next element of the array. When indexed,
it will index inside the array. It __never__ points to the array, only
to it's elements, first or otherwise.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
From the C standard this is the definition of a ponter-type:
"A pointer type describes an object whose value provides a reference to an
entity of the referenced type."

This is only part of the definiton, the whole definition is publicly
available in the C standard, and I am not trying to hide anything I am
quoting the part I think is releveant.

The value of a pointer provides a reference to an entity, of the referenced
type.

For a pointer to reference and array of T's, it must be type T*. T is the
referenced type not T[Size].

A pointer to T[Size], such as T (*p)[Size], does not reference the array,it
referneces an array-type, which is a different object than the array. It is,
under the hood, another pointer object, it does not reference THE ARRAY of
T's, it references a different array-type object.

You have no idea what you are talking about. Specifically, "A pointer
to T[Size], such as T (*p)[Size], does not reference the array, it
referneces an array-type, which is a different object than the array"
is simply nonsense. Among other things, it is nonsense because you are
mixing "array-type" and "object" (the latter being an instance of a
type).

You are also making stuff up as you go along. Standard __nowhere__
says that pointer references anything. It does say that pointer points
to something.

Therefore, your explanation is worthless.

Goran.
 
P

Paul

Standard does no such thing. not. You made a leap from "array of
dimension n, when it appears in an expression, is __converted__ to a
pointer to an array of the dimension n-1. The opposite is not true,
and standard does not say that. You are misinterpreting that passage.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Yes so if we convert an array to a pointer , the resulting pointer is a
pointer to an (n-1) dim array.
So now we have a pointer to the array, the pointer-type just happens to
be
type pointer to (n-1) dim array.

The pointer-type says what the pointer __is__. When dereferenced, it
will give you a reference to the first element of the array. When
incremented, it will give you next element of the array. When indexed,
it will index inside the array. It __never__ points to the array, only
to it's elements, first or otherwise.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
From the C standard this is the definition of a ponter-type:
"A pointer type describes an object whose value provides a reference to an
entity of the referenced type."

This is only part of the definiton, the whole definition is publicly
available in the C standard, and I am not trying to hide anything I am
quoting the part I think is releveant.

The value of a pointer provides a reference to an entity, of the
referenced
type.

For a pointer to reference and array of T's, it must be type T*. T is the
referenced type not T[Size].

A pointer to T[Size], such as T (*p)[Size], does not reference the array,
it
referneces an array-type, which is a different object than the array. It
is,
under the hood, another pointer object, it does not reference THE ARRAY of
T's, it references a different array-type object.

You have no idea what you are talking about. Specifically, "A pointer
to T[Size], such as T (*p)[Size], does not reference the array, it
referneces an array-type, which is a different object than the array"
is simply nonsense. Among other things, it is nonsense because you are
mixing "array-type" and "object" (the latter being an instance of a
type).
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
An array-type object is not an instance of a type. Its a fancy pointer with
typeinfo.
Apparently you have no idea, for example the object "arr" is an instance of
what type ?
int arr[10];

This is an array-type object. The instances here are the instances of
integer objects that make up the array.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

You are also making stuff up as you go along. Standard __nowhere__
says that pointer references anything. It does say that pointer points
to something.

Therefore, your explanation is worthless.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Its in the definition that C++ inherits from the C standard.

"Apointer type may be derived from a function type, an object type, or an
incomplete
type, called the referenced type. A pointer type describes an object whose
value
provides a reference to an entity of the referenced type. A pointer type
derived from
the referenced type T is sometimes called ''pointer to T''. The construction
of a
pointer type from a referenced type is called ''pointer type derivation''."
 
G

Goran

"Goran" <[email protected]> wrote in message
The pointer-type says what the pointer __is__. When dereferenced, it
will give you a reference to the first element of the array. When
incremented, it will give you next element of the array. When indexed,
it will index inside the array. It __never__ points to the array, only
to it's elements, first or otherwise.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
From the C standard this is the definition of a ponter-type:
"A pointer type describes an object whose value provides a reference toan
entity of the referenced type."
This is only part of the definiton, the whole definition is publicly
available in the C standard, and I am not trying to hide anything I am
quoting the part I think is releveant.
The value of a pointer provides a reference to an entity, of the
referenced
type.
For a pointer to reference and array of T's, it must be type T*. T is the
referenced type not T[Size].
A pointer to T[Size], such as T (*p)[Size], does not reference the array,
it
referneces an array-type, which is a different object than the array. It
is,
under the hood, another pointer object, it does not reference THE ARRAYof
T's, it references a different array-type object.

You have no idea what you are talking about. Specifically, "A pointer
to T[Size], such as T (*p)[Size], does not reference the array, it
referneces an array-type, which is a different object than the array"
is simply nonsense. Among other things, it is nonsense because you are
mixing "array-type" and "object" (the latter being an instance of a
type).
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
An array-type object is not an instance of a type. Its a fancy pointer with
typeinfo.
Apparently you have no idea, for example the object "arr" is an instance of
what type ?
int arr[10];

This is an array-type object. The instances here are the instances of
integer objects that make up the array.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

What you said up here is pretty correct. However, that bears no
relevance to what I quoted you about:

"A pointer to T[Size], such as T (*p)[Size], does not reference the
array, it referneces an array-type, which is a different object than
the array."

The above is still nonsense, and your subsequent post didn't explain
anything in there.
You are also making stuff up as you go along. Standard __nowhere__
says that pointer references anything. It does say that pointer points
to something.

Therefore, your explanation is worthless.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Its in the definition that C++ inherits from the C standard.

"Apointer type may be derived from a function type, an object type, or an
incomplete
type, called the referenced type. A pointer type describes an object whose
value
provides a reference to an entity of the referenced type. A pointer type
derived from
the referenced type T is sometimes called ''pointer to T''. The construction
of a
pointer type from a referenced type is called ''pointer type derivation''.."

My words "standard never says that pointer references anything" are
correct. Your standard quote, e.g. "A pointer type derived from the
referenced type T is sometimes called ''pointer to T''" does not say,
nor mean, that pointer __references__ anything, which is what you
previous post said. Pointer __points to__ something, and this is what
standard does say. And especially in the context of C++, word
"reference" typically has another meaning.

I believe that you are arbitrarily muddying things up to support your
worthless point.

Goran.
 
P

Paul

The pointer-type says what the pointer __is__. When dereferenced, it
will give you a reference to the first element of the array. When
incremented, it will give you next element of the array. When indexed,
it will index inside the array. It __never__ points to the array, only
to it's elements, first or otherwise.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
From the C standard this is the definition of a ponter-type:
"A pointer type describes an object whose value provides a reference to
an
entity of the referenced type."
This is only part of the definiton, the whole definition is publicly
available in the C standard, and I am not trying to hide anything I am
quoting the part I think is releveant.
The value of a pointer provides a reference to an entity, of the
referenced
type.
For a pointer to reference and array of T's, it must be type T*. T is
the
referenced type not T[Size].
A pointer to T[Size], such as T (*p)[Size], does not reference the
array,
it
referneces an array-type, which is a different object than the array. It
is,
under the hood, another pointer object, it does not reference THE ARRAY
of
T's, it references a different array-type object.

You have no idea what you are talking about. Specifically, "A pointer
to T[Size], such as T (*p)[Size], does not reference the array, it
referneces an array-type, which is a different object than the array"
is simply nonsense. Among other things, it is nonsense because you are
mixing "array-type" and "object" (the latter being an instance of a
type).
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
An array-type object is not an instance of a type. Its a fancy pointer
with
typeinfo.
Apparently you have no idea, for example the object "arr" is an instance
of
what type ?
int arr[10];

This is an array-type object. The instances here are the instances of
integer objects that make up the array.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

What you said up here is pretty correct. However, that bears no
relevance to what I quoted you about:

"A pointer to T[Size], such as T (*p)[Size], does not reference the
array, it referneces an array-type, which is a different object than
the array."

The above is still nonsense, and your subsequent post didn't explain
anything in there.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The only nonsesne is coming from you.
You are trying to argue that a pointer to an array of chars, is a pointer to
an array-type object and not a pointer to char type objects.
Which is obviously technically incorrect.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

You are also making stuff up as you go along. Standard __nowhere__
says that pointer references anything. It does say that pointer points
to something.

Therefore, your explanation is worthless.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Its in the definition that C++ inherits from the C standard.

"Apointer type may be derived from a function type, an object type, or an
incomplete
type, called the referenced type. A pointer type describes an object whose
value
provides a reference to an entity of the referenced type. A pointer type
derived from
the referenced type T is sometimes called ''pointer to T''. The
construction
of a
pointer type from a referenced type is called ''pointer type
derivation''."

My words "standard never says that pointer references anything" are
correct. Your standard quote, e.g. "A pointer type derived from the
referenced type T is sometimes called ''pointer to T''" does not say,
nor mean, that pointer __references__ anything, which is what you
previous post said. Pointer __points to__ something, and this is what
standard does say. And especially in the context of C++, word
"reference" typically has another meaning.

I believe that you are arbitrarily muddying things up to support your
worthless point.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Its quite obviously you that are muddying things up.
You seem to speaking a big pile of shit abut what your interpretation of
"references" is.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top