You snipped something.

Discussion in 'C++' started by Paul, Mar 22, 2011.

1. PaulGuest

You snipped something Leigh , please don't ignore this:

Odd multiples of > denotes Leigh bollocks..

>>>>> You fail yet again. I never said "pa" was not a pointer to an array;
>>>>> of course it is a pointer to an array; it is a pointer to a 1d array
>>>>> of type int[42].
>>>>>
>>>> It's a pointer to a 2d array
>>>> According to you any dynamic array is, not unlike you, 1 dimension
>>>> short
>>>> of a picnic.
>>>
>>> int (*pa)[42] = new int[42][42];
>>>
>>> "pa" is a pointer to a 1D array of type int[42]; this is an
>>> indisputable fact. The fact that what it points to is the initial
>>> element of a 2D array of type int[42][42] is irrelevant.
>>>

>> It's a pointer to....*drumroll* ..... what it points-to .
>> You are a confused idiot. Read the standards.

>
>

The standard states : "If the * operator, either explicitly or implicitly as
a result of subscripting, is applied to this pointer, the result is the
pointedto (n - 1 )dimensional array"
.............
(*pa) produces the **pointedto** (n-1) dimensional array. That is.... if pa
is the **pointedto** 2dim array(which it is) then derefenrencing it should
result in a 1dim array.

std::cout<< typeid(*pa).name(); /*int [42]*/

e voila!
Proven wrong once again.

>>
>>>>
>>>>
>>>> READ THE C++ STANDARDS.
>>>> "A consistent rule is followed for multidimensional arrays. If E is an
>>>> ndimensional
>>>> array of rank
>>>> i´ j´ . . . ´k, then E appearing in an expression is converted to a
>>>> pointer to an (n - 1 )dimensional
>>>> array
>>>> with rank j´ . . . ´k. If the * operator, either explicitly or
>>>> implicitly as a result of subscripting, is applied to
>>>> this pointer, the result is the pointedto
>>>> (n - 1 )dimensional
>>>> array, which itself is immediately converted
>>>> into a pointer."
>>>
>>> Irrelevant; what is relevant is the type of an object.
>>>

>> I rest my case.

Lets see how he tries to wangle out of this one

Paul, Mar 22, 2011

2. PaulGuest

"Leigh Johnston" <> wrote in message
news:...
> On 22/03/2011 21:13, Paul wrote:
>> You snipped something Leigh , please don't ignore this:
>>
>> Odd multiples of > denotes Leigh bollocks..
>>
>>>>>>> You fail yet again. I never said "pa" was not a pointer to an array;
>>>>>>> of course it is a pointer to an array; it is a pointer to a 1d array
>>>>>>> of type int[42].
>>>>>>>
>>>>>> It's a pointer to a 2d array
>>>>>> According to you any dynamic array is, not unlike you, 1 dimension
>>>>>> short
>>>>>> of a picnic.
>>>>>
>>>>> int (*pa)[42] = new int[42][42];
>>>>>
>>>>> "pa" is a pointer to a 1D array of type int[42]; this is an
>>>>> indisputable fact. The fact that what it points to is the initial
>>>>> element of a 2D array of type int[42][42] is irrelevant.
>>>>>
>>>> It's a pointer to....*drumroll* ..... what it points-to .
>>>> You are a confused idiot. Read the standards.
>>>
>>>

>> The standard states : "If the * operator, either explicitly or
>> implicitly as
>> a result of subscripting, is applied to this pointer, the result is the
>> pointedto (n - 1 )dimensional array"
>> ............
>> (*pa) produces the **pointedto** (n-1) dimensional array. That is.... if
>> pa
>> is the **pointedto** 2dim array(which it is) then derefenrencing it
>> should
>> result in a 1dim array.
>>
>> std::cout<< typeid(*pa).name(); /*int [42]*/
>>
>> e voila!
>> Proven wrong once again.
>> READ THE STANDARDS.
>>
>>>>
>>>>>>
>>>>>>
>>>>>> READ THE C++ STANDARDS.
>>>>>> "A consistent rule is followed for multidimensional arrays. If E is
>>>>>> an
>>>>>> ndimensional
>>>>>> array of rank
>>>>>> i´ j´ . . . ´k, then E appearing in an expression is converted to a
>>>>>> pointer to an (n - 1 )dimensional
>>>>>> array
>>>>>> with rank j´ . . . ´k. If the * operator, either explicitly or
>>>>>> implicitly as a result of subscripting, is applied to
>>>>>> this pointer, the result is the pointedto
>>>>>> (n - 1 )dimensional
>>>>>> array, which itself is immediately converted
>>>>>> into a pointer."
>>>>>
>>>>> Irrelevant; what is relevant is the type of an object.
>>>>>
>>>> I rest my case.

>>
>>
>> Lets see how he tries to wangle out of this one
>>

>
> The inane ramblings of a demented freak.
>

So it's safe to assert you have created your own version f the C++ language.
And you refuse to accept the real C++ language, even when it's presented to
you in plain black'n'white.

GL troll , noob and idiot.

Paul, Mar 22, 2011

3. Noah RobertsGuest

On 3/22/2011 2:21 PM, Leigh Johnston wrote:
[huge, full quotation of pointless thread of bullshit]
>>

>
> The inane ramblings of a demented freak.
>
> /Leigh

*plonk*
--
http://crazycpp.wordpress.com

Noah Roberts, Mar 22, 2011
4. PaulGuest

"Noah Roberts" <> wrote in message
news:4d89158d\$0\$17190\$...
> On 3/22/2011 2:21 PM, Leigh Johnston wrote:
> [huge, full quotation of pointless thread of bullshit]
>>>

>>
>> The inane ramblings of a demented freak.
>>
>> /Leigh

>
> *plonk*
> --
> http://crazycpp.wordpress.com
>

You may think its a pile of pointless bullshit but its amazing just how many
people are confused by this, I believe you were/are one of them.

I understand why you are confused, because it seem logical that a pointer to
a type points to an object of that type. But it doesnt work this way with
arrays and once you understand why its pretty clear and obvious.
A pointer of type int* points to an int.
A pointer of type float* points a float
etc etc
And its simple to understand that when these pointers are derefernced they
return an int or a float value from the memory.

But with arrays you cannot have a pointer to an array of floats all at once,
so some choices are:
a) Have a pointer of the same type as the element. When dereferenced it
returns an object of element type. (seems perfect)
b) Have a pointer of type... int (*)[Size] (for example type). When
dereference is returns an array of same dimension. (not good but is perfect
for an array of Size+1 dimension)

And so it was the C++ pointer to array system was implemented. And the C++
standards were written.
If you think its bullshit then complain tot he authoroties. I think its
pretty simple, flexible and very easy to use. I'm happy with it

GL

Paul, Mar 23, 2011
5. JamesGuest

"Leigh Johnston" <> wrote in message
news:...
> On 22/03/2011 21:28, Paul wrote:

[...]

> I hope you were lying about your age because a 57 year old behaving like
> you do is only explainable if you have just woken up from a 40 year coma.
>
> Take your pills.

LOL! :^D

James, Mar 23, 2011
6. Peter RemmersGuest

Am 23.03.2011 03:31, schrieb Paul:
>
> "Noah Roberts"<> wrote in message
> news:4d89158d\$0\$17190\$...
>> On 3/22/2011 2:21 PM, Leigh Johnston wrote:
>> [huge, full quotation of pointless thread of bullshit]
>>>>
>>>
>>> The inane ramblings of a demented freak.
>>>
>>> /Leigh

>>
>> *plonk*
>> --
>> http://crazycpp.wordpress.com
>>

> You may think its a pile of pointless bullshit but its amazing just how many
> people are confused by this, I believe you were/are one of them.
>
> I understand why you are confused, because it seem logical that a pointer to
> a type points to an object of that type. But it doesnt work this way with
> arrays and once you understand why its pretty clear and obvious.

You only see it from an observer's viewpoint. You experimented, saw how
things seemed to work, and so to you that's how it must be. You never
learned the technical details behind that behaviour. All your arguments
make it pretty obvious, including that member function thing. Sure, on
the surface they seem to be part of objects, they behave like they are
part of objects, but when you poke in the right spots, you'll notice
that under the hood they really aren't.

> A pointer of type int* points to an int.
> A pointer of type float* points a float
> etc etc
> And its simple to understand that when these pointers are derefernced they
> return an int or a float value from the memory.
>
> But with arrays you cannot have a pointer to an array of floats all at once,
> so some choices are:
> a) Have a pointer of the same type as the element. When dereferenced it
> returns an object of element type. (seems perfect)
> b) Have a pointer of type... int (*)[Size] (for example type). When
> dereference is returns an array of same dimension. (not good but is perfect
> for an array of Size+1 dimension)

The type says that it points "to an array of floats all at once" like
you said. And the "all at once" part is literally true because if you
increment the pointer, it points to the next whole array.

> And so it was the C++ pointer to array system was implemented. And the C++
> standards were written.

LOL. You make it sound like the genesis from the bible. Yet I doubt you
have any clue how C++ really came to existence. I know I don't, because
I wasn't there.

> If you think its bullshit then complain tot he authoroties. I think its
> pretty simple, flexible and very easy to use. I'm happy with it

To you, those pointers are ducks:

If it looks like a duck, quacks like a duck, toddles like a duck, then
it must be a duck!

If it looks like a pointer to an array, behaves like a pointer to an
array, then it must be a pointer to an array!

If it looks like the function is part of an object, and can be used as
if it were part of an object, then it must be part of an object!

And to you that's good enough and all you need to know and want to know.
You have made your opinion. To you that's how it is and how it has to
be. You don't care how it really is, and everyone who tries to tell you
that in reality it's a little bit different gets snubbed.

> GL

Luck is not involved here.

Peter

Peter Remmers, Mar 23, 2011
7. PaulGuest

"Leigh Johnston" <> wrote in message
news:...
> On 22/03/2011 21:28, Paul wrote:
>>
>>>> Odd multiples of > denotes Leigh bollocks..
>>>>
>>>>>>>>> You fail yet again. I never said "pa" was not a pointer to an
>>>>>>>>> array;
>>>>>>>>> of course it is a pointer to an array; it is a pointer to a 1d
>>>>>>>>> array
>>>>>>>>> of type int[42].

No its a pointer to a 2D array of objects of type int[42];

>>>>>>>>>
>>>>>>>> It's a pointer to a 2d array
>>>>>>>> According to you any dynamic array is, not unlike you, 1 dimension
>>>>>>>> short
>>>>>>>> of a picnic.
>>>>>>>
>>>>>>> int (*pa)[42] = new int[42][42];
>>>>>>>
>>>>>>> "pa" is a pointer to a 1D array of type int[42]; this is an
>>>>>>> indisputable fact. The fact that what it points to is the initial
>>>>>>> element of a 2D array of type int[42][42] is irrelevant.
>>>>>>>

No its a pointer to a 2D array of objects of type int[42];

>>>>>> It's a pointer to....*drumroll* ..... what it points-to .
>>>>>> You are a confused idiot. Read the standards.
>>>>>
>>>>>
>>>> The standard states : "If the * operator, either explicitly or
>>>> implicitly as
>>>> a result of subscripting, is applied to this pointer, the result is the
>>>> pointedto (n - 1 )dimensional array"
>>>> ............
>>>> (*pa) produces the **pointedto** (n-1) dimensional array. That is....
>>>> if pa
>>>> is the **pointedto** 2dim array(which it is) then derefenrencing it
>>>> should
>>>> result in a 1dim array.
>>>>
>>>> std::cout<< typeid(*pa).name(); /*int [42]*/
>>>>
>>>> e voila!
>>>> Proven wrong once again.
>>>> READ THE STANDARDS.
>>>>
>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> READ THE C++ STANDARDS.
>>>>>>>> "A consistent rule is followed for multidimensional arrays. If E
>>>>>>>> is an
>>>>>>>> ndimensional
>>>>>>>> array of rank
>>>>>>>> i´ j´ . . . ´k, then E appearing in an expression is converted to a
>>>>>>>> pointer to an (n - 1 )dimensional
>>>>>>>> array
>>>>>>>> with rank j´ . . . ´k. If the * operator, either explicitly or
>>>>>>>> implicitly as a result of subscripting, is applied to
>>>>>>>> this pointer, the result is the pointedto
>>>>>>>> (n - 1 )dimensional
>>>>>>>> array, which itself is immediately converted
>>>>>>>> into a pointer."
>>>>>>>
>>>>>>> Irrelevant; what is relevant is the type of an object.
>>>>>>>
>>>>>> I rest my case.
>>>>
>>>>
>>>> Lets see how he tries to wangle out of this one
>>>>
>>>
>>> The inane ramblings of a demented freak.
>>>

>> So it's safe to assert you have created your own version f the C++
>> language. And you refuse to accept the real C++ language, even when it's
>> presented to you in plain black'n'white.
>>
>> GL troll , noob and idiot.
>>

>
> I hope you were lying about your age because a 57 year old behaving like
> you do is only explainable if you have just woken up from a 40 year coma.
>
> Take your pills.
>

So you accept you are nothing more than a troll, noob and idiot. Or do you
accept that you were/are wrong?
Even if i was on medication it would obvioulsy be a good thing because it
makes me think in a correct way, unlike you( whether you take pills or
not ).

Once again you have been PROVEN WRONG!
I count that to be about 10 v 0 to me , I win. ner ner noob.

Paul, Mar 23, 2011
8. PaulGuest

"Leigh Johnston" <> wrote in message
news:...
> On 23/03/2011 13:29, Paul wrote:
>>>>>> Odd multiples of > denotes Leigh bollocks..
>>>>>>
>>>>>>>>>>> You fail yet again. I never said "pa" was not a pointer to an
>>>>>>>>>>> array;
>>>>>>>>>>> of course it is a pointer to an array; it is a pointer to a 1d
>>>>>>>>>>> array
>>>>>>>>>>> of type int[42].

>>
>> No its a pointer to a 2D array of objects of type int[42];
>>
>>>>>>>>>>>
>>>>>>>>>> It's a pointer to a 2d array
>>>>>>>>>> According to you any dynamic array is, not unlike you, 1
>>>>>>>>>> dimension
>>>>>>>>>> short
>>>>>>>>>> of a picnic.
>>>>>>>>>
>>>>>>>>> int (*pa)[42] = new int[42][42];
>>>>>>>>>
>>>>>>>>> "pa" is a pointer to a 1D array of type int[42]; this is an
>>>>>>>>> indisputable fact. The fact that what it points to is the initial
>>>>>>>>> element of a 2D array of type int[42][42] is irrelevant.
>>>>>>>>>

>>
>> No its a pointer to a 2D array of objects of type int[42];
>>
>>>>>>>> It's a pointer to....*drumroll* ..... what it points-to .
>>>>>>>> You are a confused idiot. Read the standards.
>>>>>>>
>>>>>>>
>>>>>> The standard states : "If the * operator, either explicitly or
>>>>>> implicitly as
>>>>>> a result of subscripting, is applied to this pointer, the result is
>>>>>> the
>>>>>> pointedto (n - 1 )dimensional array"
>>>>>> ............
>>>>>> (*pa) produces the **pointedto** (n-1) dimensional array. That is....
>>>>>> if pa
>>>>>> is the **pointedto** 2dim array(which it is) then derefenrencing it
>>>>>> should
>>>>>> result in a 1dim array.
>>>>>>
>>>>>> std::cout<< typeid(*pa).name(); /*int [42]*/
>>>>>>
>>>>>> e voila!
>>>>>> Proven wrong once again.
>>>>>> READ THE STANDARDS.
>>>>>>
>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> READ THE C++ STANDARDS.
>>>>>>>>>> "A consistent rule is followed for multidimensional arrays. If E
>>>>>>>>>> is an
>>>>>>>>>> ndimensional
>>>>>>>>>> array of rank
>>>>>>>>>> i´ j´ . . . ´k, then E appearing in an expression is converted
>>>>>>>>>> to a
>>>>>>>>>> pointer to an (n - 1 )dimensional
>>>>>>>>>> array
>>>>>>>>>> with rank j´ . . . ´k. If the * operator, either explicitly or
>>>>>>>>>> implicitly as a result of subscripting, is applied to
>>>>>>>>>> this pointer, the result is the pointedto
>>>>>>>>>> (n - 1 )dimensional
>>>>>>>>>> array, which itself is immediately converted
>>>>>>>>>> into a pointer."
>>>>>>>>>
>>>>>>>>> Irrelevant; what is relevant is the type of an object.
>>>>>>>>>
>>>>>>>> I rest my case.
>>>>>>
>>>>>>
>>>>>> Lets see how he tries to wangle out of this one
>>>>>>
>>>>>
>>>>> The inane ramblings of a demented freak.
>>>>>
>>>> So it's safe to assert you have created your own version f the C++
>>>> language. And you refuse to accept the real C++ language, even when
>>>> it's
>>>> presented to you in plain black'n'white.
>>>>
>>>> GL troll , noob and idiot.
>>>>
>>>
>>> I hope you were lying about your age because a 57 year old behaving
>>> like you do is only explainable if you have just woken up from a 40
>>> year coma.
>>>
>>> Take your pills.
>>>

>>
>> So you accept you are nothing more than a troll, noob and idiot. Or do
>> you accept that you were/are wrong?

>
> I accept neither.
>

You do not accept the text in the C++ standard as a rule for the language?

<snip trolling>

Paul, Mar 23, 2011
9. PaulGuest

"Leigh Johnston" <> wrote in message
news:...
> On 23/03/2011 16:31, Paul wrote:
>>
>> "Leigh Johnston" <> wrote in message
>> news:...
>>> On 23/03/2011 13:29, Paul wrote:
>>>>>>>> Odd multiples of > denotes Leigh bollocks..
>>>>>>>>
>>>>>>>>>>>>> You fail yet again. I never said "pa" was not a pointer to an
>>>>>>>>>>>>> array;
>>>>>>>>>>>>> of course it is a pointer to an array; it is a pointer to a 1d
>>>>>>>>>>>>> array
>>>>>>>>>>>>> of type int[42].
>>>>
>>>> No its a pointer to a 2D array of objects of type int[42];
>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>> It's a pointer to a 2d array
>>>>>>>>>>>> According to you any dynamic array is, not unlike you, 1
>>>>>>>>>>>> dimension
>>>>>>>>>>>> short
>>>>>>>>>>>> of a picnic.
>>>>>>>>>>>
>>>>>>>>>>> int (*pa)[42] = new int[42][42];
>>>>>>>>>>>
>>>>>>>>>>> "pa" is a pointer to a 1D array of type int[42]; this is an
>>>>>>>>>>> indisputable fact. The fact that what it points to is the
>>>>>>>>>>> initial
>>>>>>>>>>> element of a 2D array of type int[42][42] is irrelevant.
>>>>>>>>>>>
>>>>
>>>> No its a pointer to a 2D array of objects of type int[42];
>>>>
>>>>>>>>>> It's a pointer to....*drumroll* ..... what it points-to .
>>>>>>>>>> You are a confused idiot. Read the standards.
>>>>>>>>>
>>>>>>>>>
>>>>>>>> The standard states : "If the * operator, either explicitly or
>>>>>>>> implicitly as
>>>>>>>> a result of subscripting, is applied to this pointer, the result is
>>>>>>>> the
>>>>>>>> pointedto (n - 1 )dimensional array"
>>>>>>>> ............
>>>>>>>> (*pa) produces the **pointedto** (n-1) dimensional array. That
>>>>>>>> is....
>>>>>>>> if pa
>>>>>>>> is the **pointedto** 2dim array(which it is) then derefenrencing it
>>>>>>>> should
>>>>>>>> result in a 1dim array.
>>>>>>>>
>>>>>>>> std::cout<< typeid(*pa).name(); /*int [42]*/
>>>>>>>>
>>>>>>>> e voila!
>>>>>>>> Proven wrong once again.
>>>>>>>> READ THE STANDARDS.
>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> READ THE C++ STANDARDS.
>>>>>>>>>>>> "A consistent rule is followed for multidimensional arrays. If
>>>>>>>>>>>> E
>>>>>>>>>>>> is an
>>>>>>>>>>>> ndimensional
>>>>>>>>>>>> array of rank
>>>>>>>>>>>> i´ j´ . . . ´k, then E appearing in an expression is converted
>>>>>>>>>>>> to a
>>>>>>>>>>>> pointer to an (n - 1 )dimensional
>>>>>>>>>>>> array
>>>>>>>>>>>> with rank j´ . . . ´k. If the * operator, either explicitly or
>>>>>>>>>>>> implicitly as a result of subscripting, is applied to
>>>>>>>>>>>> this pointer, the result is the pointedto
>>>>>>>>>>>> (n - 1 )dimensional
>>>>>>>>>>>> array, which itself is immediately converted
>>>>>>>>>>>> into a pointer."
>>>>>>>>>>>
>>>>>>>>>>> Irrelevant; what is relevant is the type of an object.
>>>>>>>>>>>
>>>>>>>>>> I rest my case.
>>>>>>>>
>>>>>>>>
>>>>>>>> Lets see how he tries to wangle out of this one
>>>>>>>>
>>>>>>>
>>>>>>> The inane ramblings of a demented freak.
>>>>>>>
>>>>>> So it's safe to assert you have created your own version f the C++
>>>>>> language. And you refuse to accept the real C++ language, even when
>>>>>> it's
>>>>>> presented to you in plain black'n'white.
>>>>>>
>>>>>> GL troll , noob and idiot.
>>>>>>
>>>>>
>>>>> I hope you were lying about your age because a 57 year old behaving
>>>>> like you do is only explainable if you have just woken up from a 40
>>>>> year coma.
>>>>>
>>>>> Take your pills.
>>>>>
>>>>
>>>> So you accept you are nothing more than a troll, noob and idiot. Or do
>>>> you accept that you were/are wrong?
>>>
>>> I accept neither.
>>>

>> You do not accept the text in the C++ standard as a rule for the
>> language?

>
> Of course I do; now show me what I have supposedly written that
> contradicts the Standard; from what I have seen you have done exactly that
> on numerous occasions in the past few months. You seem to have a habit of
> posting parts of the standard unrelated to a point under discussion and of
> posting false claims of contradictions of the Standard.
>

Ok lets start with just one of your statements in this post:

>>>>>>>>>>> int (*pa)[42] = new int[42][42];
>>>>>>>>>>>
>>>>>>>>>>> "pa" is a pointer to a 1D array of type int[42]; this is an
>>>>>>>>>>> indisputable fact. The fact that what it points to is the
>>>>>>>>>>> initial
>>>>>>>>>>> element of a 2D array of type int[42][42] is irrelevant.

Wrong its a pointer to a 2d array according to the C++ standards.

(*pa) produces the pointedto (n-1) dimensional array. That is.... if pa is
the pointedto 2dim array(which it is) then derefenrencing it should result
in a 1dim array.

std::cout<< typeid(*pa).name(); /* Voila, dereferencing produces a 1dim
array.*/

The standard states : "If the * operator, either explicitly or implicitly as
a result of subscripting, is applied to this pointer, the result is the
pointedto (n - 1 )dimensional array".

Paul, Mar 23, 2011
10. PaulGuest

"Leigh Johnston" <> wrote in message
news:...
> On 23/03/2011 17:24, Paul wrote:
>>>>> On 23/03/2011 13:29, Paul wrote:
>>>>>>>>>> Odd multiples of > denotes Leigh bollocks..
>>>>>>>>>>
>>>>>>>>>>>>>>> You fail yet again. I never said "pa" was not a pointer to
>>>>>>>>>>>>>>> an
>>>>>>>>>>>>>>> array;
>>>>>>>>>>>>>>> of course it is a pointer to an array; it is a pointer to
>>>>>>>>>>>>>>> a 1d
>>>>>>>>>>>>>>> array
>>>>>>>>>>>>>>> of type int[42].
>>>>>>
>>>>>> No its a pointer to a 2D array of objects of type int[42];
>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> It's a pointer to a 2d array
>>>>>>>>>>>>>> According to you any dynamic array is, not unlike you, 1
>>>>>>>>>>>>>> dimension
>>>>>>>>>>>>>> short
>>>>>>>>>>>>>> of a picnic.
>>>>>>>>>>>>>
>>>>>>>>>>>>> int (*pa)[42] = new int[42][42];
>>>>>>>>>>>>>
>>>>>>>>>>>>> "pa" is a pointer to a 1D array of type int[42]; this is an
>>>>>>>>>>>>> indisputable fact. The fact that what it points to is the
>>>>>>>>>>>>> initial
>>>>>>>>>>>>> element of a 2D array of type int[42][42] is irrelevant.
>>>>>>>>>>>>>
>>>>>>
>>>>>> No its a pointer to a 2D array of objects of type int[42];
>>>>>>
>>>>>>>>>>>> It's a pointer to....*drumroll* ..... what it points-to .
>>>>>>>>>>>> You are a confused idiot. Read the standards.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>> The standard states : "If the * operator, either explicitly or
>>>>>>>>>> implicitly as
>>>>>>>>>> a result of subscripting, is applied to this pointer, the
>>>>>>>>>> result is
>>>>>>>>>> the
>>>>>>>>>> pointedto (n - 1 )dimensional array"
>>>>>>>>>> ............
>>>>>>>>>> (*pa) produces the **pointedto** (n-1) dimensional array. That
>>>>>>>>>> is....
>>>>>>>>>> if pa
>>>>>>>>>> is the **pointedto** 2dim array(which it is) then
>>>>>>>>>> derefenrencing it
>>>>>>>>>> should
>>>>>>>>>> result in a 1dim array.
>>>>>>>>>>
>>>>>>>>>> std::cout<< typeid(*pa).name(); /*int [42]*/
>>>>>>>>>>
>>>>>>>>>> e voila!
>>>>>>>>>> Proven wrong once again.
>>>>>>>>>> READ THE STANDARDS.
>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> READ THE C++ STANDARDS.
>>>>>>>>>>>>>> "A consistent rule is followed for multidimensional arrays.
>>>>>>>>>>>>>> If E
>>>>>>>>>>>>>> is an
>>>>>>>>>>>>>> ndimensional
>>>>>>>>>>>>>> array of rank
>>>>>>>>>>>>>> i´ j´ . . . ´k, then E appearing in an expression is
>>>>>>>>>>>>>> converted
>>>>>>>>>>>>>> to a
>>>>>>>>>>>>>> pointer to an (n - 1 )dimensional
>>>>>>>>>>>>>> array
>>>>>>>>>>>>>> with rank j´ . . . ´k. If the * operator, either explicitly
>>>>>>>>>>>>>> or
>>>>>>>>>>>>>> implicitly as a result of subscripting, is applied to
>>>>>>>>>>>>>> this pointer, the result is the pointedto
>>>>>>>>>>>>>> (n - 1 )dimensional
>>>>>>>>>>>>>> array, which itself is immediately converted
>>>>>>>>>>>>>> into a pointer."
>>>>>>>>>>>>>
>>>>>>>>>>>>> Irrelevant; what is relevant is the type of an object.
>>>>>>>>>>>>>
>>>>>>>>>>>> I rest my case.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Lets see how he tries to wangle out of this one
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> The inane ramblings of a demented freak.
>>>>>>>>>
>>>>>>>> So it's safe to assert you have created your own version f the C++
>>>>>>>> language. And you refuse to accept the real C++ language, even when
>>>>>>>> it's
>>>>>>>> presented to you in plain black'n'white.
>>>>>>>>
>>>>>>>> GL troll , noob and idiot.
>>>>>>>>
>>>>>>>
>>>>>>> I hope you were lying about your age because a 57 year old behaving
>>>>>>> like you do is only explainable if you have just woken up from a 40
>>>>>>> year coma.
>>>>>>>
>>>>>>> Take your pills.
>>>>>>>
>>>>>>
>>>>>> So you accept you are nothing more than a troll, noob and idiot. Or
>>>>>> do
>>>>>> you accept that you were/are wrong?
>>>>>
>>>>> I accept neither.
>>>>>
>>>> You do not accept the text in the C++ standard as a rule for the
>>>> language?
>>>
>>> Of course I do; now show me what I have supposedly written that
>>> contradicts the Standard; from what I have seen you have done exactly
>>> that on numerous occasions in the past few months. You seem to have a
>>> habit of posting parts of the standard unrelated to a point under
>>> discussion and of posting false claims of contradictions of the
>>> Standard.
>>>

>>
>> Ok lets start with just one of your statements in this post:
>>
>>>>>>>>>>>>> int (*pa)[42] = new int[42][42];
>>>>>>>>>>>>>
>>>>>>>>>>>>> "pa" is a pointer to a 1D array of type int[42]; this is an
>>>>>>>>>>>>> indisputable fact. The fact that what it points to is the
>>>>>>>>>>>>> initial
>>>>>>>>>>>>> element of a 2D array of type int[42][42] is irrelevant.

>>
>> Wrong its a pointer to a 2d array according to the C++ standards.
>>
>> (*pa) produces the pointedto (n-1) dimensional array. That is.... if pa
>> is the pointedto 2dim array(which it is) then derefenrencing it should
>> result in a 1dim array.

>
> (*pa) produces the one dimensional array because pa is a pointer to a one
> dimensional array (not a pointer to a two dimensional array), as I said;
> ergo the only thing I am contradicting is your nonsense not the standard.

If pa points to an 1dim array how can (*pa) would produce a 1dim array?
Obviously this is incorrect as the standard clearly states that (*pa) will
produce an (n-1) dimensional array.

<snip trolling>

Paul, Mar 23, 2011
11. PaulGuest

"Leigh Johnston" <> wrote in message
news:...
> On 23/03/2011 18:31, Paul wrote:
>>
>> "Leigh Johnston" <> wrote in message
>> news:...
>>> On 23/03/2011 17:24, Paul wrote:
>>>>>>> On 23/03/2011 13:29, Paul wrote:
>>>>>>>>>>>> Odd multiples of > denotes Leigh bollocks..
>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> You fail yet again. I never said "pa" was not a pointer
>>>>>>>>>>>>>>>>> to an
>>>>>>>>>>>>>>>>> array;
>>>>>>>>>>>>>>>>> of course it is a pointer to an array; it is a pointer to
>>>>>>>>>>>>>>>>> a 1d
>>>>>>>>>>>>>>>>> array
>>>>>>>>>>>>>>>>> of type int[42].
>>>>>>>>
>>>>>>>> No its a pointer to a 2D array of objects of type int[42];
>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> It's a pointer to a 2d array
>>>>>>>>>>>>>>>> According to you any dynamic array is, not unlike you, 1
>>>>>>>>>>>>>>>> dimension
>>>>>>>>>>>>>>>> short
>>>>>>>>>>>>>>>> of a picnic.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> int (*pa)[42] = new int[42][42];
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> "pa" is a pointer to a 1D array of type int[42]; this is an
>>>>>>>>>>>>>>> indisputable fact. The fact that what it points to is the
>>>>>>>>>>>>>>> initial
>>>>>>>>>>>>>>> element of a 2D array of type int[42][42] is irrelevant.
>>>>>>>>>>>>>>>
>>>>>>>>
>>>>>>>> No its a pointer to a 2D array of objects of type int[42];
>>>>>>>>
>>>>>>>>>>>>>> It's a pointer to....*drumroll* ..... what it points-to .
>>>>>>>>>>>>>> You are a confused idiot. Read the standards.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>> The standard states : "If the * operator, either explicitly or
>>>>>>>>>>>> implicitly as
>>>>>>>>>>>> a result of subscripting, is applied to this pointer, the
>>>>>>>>>>>> result is
>>>>>>>>>>>> the
>>>>>>>>>>>> pointedto (n - 1 )dimensional array"
>>>>>>>>>>>> ............
>>>>>>>>>>>> (*pa) produces the **pointedto** (n-1) dimensional array. That
>>>>>>>>>>>> is....
>>>>>>>>>>>> if pa
>>>>>>>>>>>> is the **pointedto** 2dim array(which it is) then
>>>>>>>>>>>> derefenrencing it
>>>>>>>>>>>> should
>>>>>>>>>>>> result in a 1dim array.
>>>>>>>>>>>>
>>>>>>>>>>>> std::cout<< typeid(*pa).name(); /*int [42]*/
>>>>>>>>>>>>
>>>>>>>>>>>> e voila!
>>>>>>>>>>>> Proven wrong once again.
>>>>>>>>>>>> READ THE STANDARDS.
>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> READ THE C++ STANDARDS.
>>>>>>>>>>>>>>>> "A consistent rule is followed for multidimensional arrays.
>>>>>>>>>>>>>>>> If E
>>>>>>>>>>>>>>>> is an
>>>>>>>>>>>>>>>> ndimensional
>>>>>>>>>>>>>>>> array of rank
>>>>>>>>>>>>>>>> i´ j´ . . . ´k, then E appearing in an expression is
>>>>>>>>>>>>>>>> converted
>>>>>>>>>>>>>>>> to a
>>>>>>>>>>>>>>>> pointer to an (n - 1 )dimensional
>>>>>>>>>>>>>>>> array
>>>>>>>>>>>>>>>> with rank j´ . . . ´k. If the * operator, either
>>>>>>>>>>>>>>>> explicitly or
>>>>>>>>>>>>>>>> implicitly as a result of subscripting, is applied to
>>>>>>>>>>>>>>>> this pointer, the result is the pointedto
>>>>>>>>>>>>>>>> (n - 1 )dimensional
>>>>>>>>>>>>>>>> array, which itself is immediately converted
>>>>>>>>>>>>>>>> into a pointer."
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Irrelevant; what is relevant is the type of an object.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I rest my case.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Lets see how he tries to wangle out of this one
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> The inane ramblings of a demented freak.
>>>>>>>>>>>
>>>>>>>>>> So it's safe to assert you have created your own version f the
>>>>>>>>>> C++
>>>>>>>>>> language. And you refuse to accept the real C++ language, even
>>>>>>>>>> when
>>>>>>>>>> it's
>>>>>>>>>> presented to you in plain black'n'white.
>>>>>>>>>>
>>>>>>>>>> GL troll , noob and idiot.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I hope you were lying about your age because a 57 year old
>>>>>>>>> behaving
>>>>>>>>> like you do is only explainable if you have just woken up from a
>>>>>>>>> 40
>>>>>>>>> year coma.
>>>>>>>>>
>>>>>>>>> Take your pills.
>>>>>>>>>
>>>>>>>>
>>>>>>>> So you accept you are nothing more than a troll, noob and idiot.
>>>>>>>> Or do
>>>>>>>> you accept that you were/are wrong?
>>>>>>>
>>>>>>> I accept neither.
>>>>>>>
>>>>>> You do not accept the text in the C++ standard as a rule for the
>>>>>> language?
>>>>>
>>>>> Of course I do; now show me what I have supposedly written that
>>>>> contradicts the Standard; from what I have seen you have done exactly
>>>>> that on numerous occasions in the past few months. You seem to have a
>>>>> habit of posting parts of the standard unrelated to a point under
>>>>> discussion and of posting false claims of contradictions of the
>>>>> Standard.
>>>>>
>>>>
>>>> Ok lets start with just one of your statements in this post:
>>>>
>>>>>>>>>>>>>>> int (*pa)[42] = new int[42][42];
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> "pa" is a pointer to a 1D array of type int[42]; this is an
>>>>>>>>>>>>>>> indisputable fact. The fact that what it points to is the
>>>>>>>>>>>>>>> initial
>>>>>>>>>>>>>>> element of a 2D array of type int[42][42] is irrelevant.
>>>>
>>>> Wrong its a pointer to a 2d array according to the C++ standards.
>>>>
>>>> (*pa) produces the pointedto (n-1) dimensional array. That is.... if pa
>>>> is the pointedto 2dim array(which it is) then derefenrencing it should
>>>> result in a 1dim array.
>>>
>>> (*pa) produces the one dimensional array because pa is a pointer to a
>>> one dimensional array (not a pointer to a two dimensional array), as I
>>> said; ergo the only thing I am contradicting is your nonsense not the
>>> standard.

>>
>> If pa points to an 1dim array how can (*pa) would produce a 1dim array?

>
> Because that is how pointer dereferencing works.

Not according to the C++ standards.
<stop snipping this>
The standard states : "If the * operator, either explicitly or implicitly as
a result of subscripting, is applied to this pointer, the result is the
pointedto (n - 1 )dimensional array".
</stop snipping this>

Are the standards not relevant when you are wrong?

Is it a case of Leigh Johnston(proven idiot) cannot accept when he is wrong?
Or Leigh Johnston accepts he is wrong?

<snip>

Paul, Mar 23, 2011
12. PaulGuest

"Leigh Johnston" <> wrote in message
news:...
> On 23/03/2011 19:10, Paul wrote:
> [...]
>>>>>>>>>>>>>>>>> int (*pa)[42] = new int[42][42];
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> "pa" is a pointer to a 1D array of type int[42]; this is
>>>>>>>>>>>>>>>>> an
>>>>>>>>>>>>>>>>> indisputable fact. The fact that what it points to is the
>>>>>>>>>>>>>>>>> initial
>>>>>>>>>>>>>>>>> element of a 2D array of type int[42][42] is irrelevant.
>>>>>>
>>>>>> Wrong its a pointer to a 2d array according to the C++ standards.
>>>>>>
>>>>>> (*pa) produces the pointedto (n-1) dimensional array. That is....
>>>>>> if pa
>>>>>> is the pointedto 2dim array(which it is) then derefenrencing it
>>>>>> should
>>>>>> result in a 1dim array.
>>>>>
>>>>> (*pa) produces the one dimensional array because pa is a pointer to a
>>>>> one dimensional array (not a pointer to a two dimensional array), as I
>>>>> said; ergo the only thing I am contradicting is your nonsense not the
>>>>> standard.
>>>>
>>>> If pa points to an 1dim array how can (*pa) would produce a 1dim array?
>>>
>>> Because that is how pointer dereferencing works.

>>
>> Not according to the C++ standards.

>
> Yes according to the C++ standards.
>
>> <stop snipping this>
>> The standard states : "If the * operator, either explicitly or
>> implicitly as
>> a result of subscripting, is applied to this pointer, the result is the
>> pointedto (n - 1 )dimensional array".
>> </stop snipping this>

>
> That part of the standard is referring to the pointer that is the result
> of an array-to-pointer conversion which is not what we are talking about:
> we are talking about a pointer to an array. Stop quoting parts of the
> standard that have no bearing on what we are actually talking about.
>

It's very relevant, its talking about subscripting an array : Here is the
whole passage:
<quote>
8.3.4 Arrays:
6 Except where it has been declared for a class (13.5.5), the subscript
operator [] is interpreted in such a way
that E1[E2] is identical to *((E1)+(E2)). Because of the conversion rules
that apply to +, if E1 is an
array and E2 an integer, then E1[E2] refers to the E2th
member of E1. Therefore, despite its asymmetric
appearance, subscripting is a commutative operation.
8.3.4 Arrays DRAFT: 2 December 1996 Declarators 8- 9

7 A consistent rule is followed for multidimensional arrays. If E is an
ndimensional
array of rank
i´ j´ . . . ´k, then E appearing in an expression is converted to a pointer
to an (n - 1 )dimensional
array
with rank j´ . . . ´k. If the * operator, either explicitly or implicitly as
a result of subscripting, is applied to
this pointer, the result is the pointedto
(n - 1 )dimensional
array, which itself is immediately converted
into a pointer.
</qutoe>

To suggest this quotation from the standard is not relevant is nothing but
complete nonsense.

So is it a case of:
a) Leigh Johnsotn(proven idiot) cannot accept he is wrong ?
or
b) Leigh Johnston accepts he is wrong?

Paul, Mar 23, 2011
13. PaulGuest

"Leigh Johnston" <> wrote in message
news:...
> On 23/03/2011 19:47, Paul wrote:
>>
>> "Leigh Johnston" <> wrote in message
>> news:...
>>> On 23/03/2011 19:10, Paul wrote:
>>> [...]
>>>>>>>>>>>>>>>>>>> int (*pa)[42] = new int[42][42];
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> "pa" is a pointer to a 1D array of type int[42]; this
>>>>>>>>>>>>>>>>>>> is an
>>>>>>>>>>>>>>>>>>> indisputable fact. The fact that what it points to is
>>>>>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>>>>>> initial
>>>>>>>>>>>>>>>>>>> element of a 2D array of type int[42][42] is irrelevant.
>>>>>>>>
>>>>>>>> Wrong its a pointer to a 2d array according to the C++ standards.
>>>>>>>>
>>>>>>>> (*pa) produces the pointedto (n-1) dimensional array. That is....
>>>>>>>> if pa
>>>>>>>> is the pointedto 2dim array(which it is) then derefenrencing it
>>>>>>>> should
>>>>>>>> result in a 1dim array.
>>>>>>>
>>>>>>> (*pa) produces the one dimensional array because pa is a pointer to
>>>>>>> a
>>>>>>> one dimensional array (not a pointer to a two dimensional array),
>>>>>>> as I
>>>>>>> said; ergo the only thing I am contradicting is your nonsense not
>>>>>>> the
>>>>>>> standard.
>>>>>>
>>>>>> If pa points to an 1dim array how can (*pa) would produce a 1dim
>>>>>> array?
>>>>>
>>>>> Because that is how pointer dereferencing works.
>>>>
>>>> Not according to the C++ standards.
>>>
>>> Yes according to the C++ standards.
>>>
>>>> <stop snipping this>
>>>> The standard states : "If the * operator, either explicitly or
>>>> implicitly as
>>>> a result of subscripting, is applied to this pointer, the result is the
>>>> pointedto (n - 1 )dimensional array".
>>>> </stop snipping this>
>>>
>>> That part of the standard is referring to the pointer that is the
>>> result of an array-to-pointer conversion which is not what we are
>>> talking about: we are talking about a pointer to an array. Stop
>>> quoting parts of the standard that have no bearing on what we are
>>> actually talking about.
>>>

>> It's very relevant, its talking about subscripting an array : Here is
>> the whole passage:
>> <quote>
>> 8.3.4 Arrays:
>> 6 Except where it has been declared for a class (13.5.5), the subscript
>> operator [] is interpreted in such a way
>> that E1[E2] is identical to *((E1)+(E2)). Because of the conversion
>> rules that apply to +, if E1 is an
>> array and E2 an integer, then E1[E2] refers to the E2th
>> member of E1. Therefore, despite its asymmetric
>> appearance, subscripting is a commutative operation.
>> 8.3.4 Arrays DRAFT: 2 December 1996 Declarators 8- 9
>>
>> 7 A consistent rule is followed for multidimensional arrays. If E is an
>> ndimensional
>> array of rank
>> i´ j´ . . . ´k, then E appearing in an expression is converted to a
>> pointer to an (n - 1 )dimensional
>> array
>> with rank j´ . . . ´k. If the * operator, either explicitly or
>> implicitly as a result of subscripting, is applied to
>> this pointer, the result is the pointedto
>> (n - 1 )dimensional
>> array, which itself is immediately converted
>> into a pointer.
>> </qutoe>

>
> You are hopeless; again you quote from the standard text that has no
> bearing on what we are talking about namely what happens when you
> dereference a pointer to an array.
>
>>
>> To suggest this quotation from the standard is not relevant is nothing
>> but complete nonsense.

>
> You, sir, are the one spouting complete and utter nonsense.
>
>>
>> So is it a case of:
>> a) Leigh Johnsotn(proven idiot) cannot accept he is wrong ?

>
> I have already told you that I admit to my mistakes. Your insults cannot
> harm me - my wings are like a shield of steel! Your insults are also
> childish.
>
>> or
>> b) Leigh Johnston accepts he is wrong?

>
> What am I wrong about exactly?
>

You are wrong about many things but in this thread you are particularly
wrong to say that with :
int* p = new int[12];
p does not point to an array.

Once again I ask you is it a case of :
a) Leigh Johnstone(proven idiot) cannot accept that he is wrong ?
or
b) Leigh Johnston accepts he is wrong?

Paul, Mar 23, 2011