Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Is this wrong for C++?

Reply
Thread Tools

Is this wrong for C++?

 
 
Goran
Guest
Posts: n/a
 
      03-25-2011
On Mar 25, 9:39*am, "Paul" <(E-Mail Removed)> wrote:
> "Goran" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed)...
> On Mar 24, 3:51 pm, "Paul" <(E-Mail Removed)> wrote:
>
> >> >So... A pointer to type always points to one instance of a type (not
> >> >an array thereof).

>
> >> <snip>

>
> >> I disagree with you and so do all the experts.

>
> >It's one thing to disagree, another to be right. What part of my
> >argument is wrong?

>
> Can't you work that out?


No. I think I offered a reasonable analysis and a correct explanation.
Please, where am I wrong?

Goran.
 
Reply With Quote
 
 
 
 
Paul
Guest
Posts: n/a
 
      03-25-2011

"Goran" <(E-Mail Removed)> wrote in message
news:fc897515-da93-4dc8-867e->
> >> >So... A pointer to type always points to one instance of a type (not
> >> >an array thereof).

>
> >> <snip>

>
> >> I disagree with you and so do all the experts.

>
> >It's one thing to disagree, another to be right. What part of my
> >argument is wrong?

>
> Can't you work that out?


--No. I think I offered a reasonable analysis and a correct explanation.
--Please, where am I wrong?

Top of page



 
Reply With Quote
 
 
 
 
Goran
Guest
Posts: n/a
 
      03-25-2011
On Mar 25, 3:32*pm, "Paul" <(E-Mail Removed)> wrote:
> "Goran" <(E-Mail Removed)> wrote in message
>
> news:fc897515-da93-4dc8-867e->
>
> > >> >So... A pointer to type always points to one instance of a type (not
> > >> >an array thereof).

>
> > >> <snip>

>
> > >> I disagree with you and so do all the experts.

>
> > >It's one thing to disagree, another to be right. What part of my
> > >argument is wrong?

>
> > Can't you work that out?

>
> --No. I think I offered a reasonable analysis and a correct explanation.
> --Please, where am I wrong?
>
> Top of page


I can't see how top of page shows me wrong. But OK, I'll try:
seemingly relevant part of the first post is the following:

"pointer can point almost anywhere: to any char, or to any contiguous
array of chars"

Even the very words I quoted do not say that said pointer __is__ a
pointer to an array. They merely say that pointer __points__ to said
array, and that is, sadly, somewhat imprecise. Lack of precision is
not normally relevant, but OK, you insist. So... The explanation I
offered shows various facets of the issue better.

(At the danger of repeating myself...) What __might happen__ is that
pointer points to a place in memory where there's several instances of
type, one after another. When that is the case, indexing the pointer
produces same result as if pointer was an array and we were indexing
the array. But this is where the buck stops. What you seem to be doing
is the following logic leap: when pointer points to the first element
of an array, it __is__ a pointer to an array. That is strictly not
true. Elsewhere people did show what "pointer to an array" is, that's
not in any way unclear.

Goran.
 
Reply With Quote
 
Paul
Guest
Posts: n/a
 
      03-25-2011

>"Goran" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>On Mar 25, 3:32 pm, "Paul" <(E-Mail Removed)> wrote:
>> "Goran" <(E-Mail Removed)> wrote in message
>>
>> news:fc897515-da93-4dc8-867e->
>>
>> > >> >So... A pointer to type always points to one instance of a type
>> > >> >(not
>> > >> >an array thereof).

>>
>> > >> <snip>

>>
>> > >> I disagree with you and so do all the experts.

>>
>> > >It's one thing to disagree, another to be right. What part of my
>> > >argument is wrong?

>>
>> > Can't you work that out?

>>
>> --No. I think I offered a reasonable analysis and a correct explanation.
>> --Please, where am I wrong?
>>
>> Top of page

>
>I can't see how top of page shows me wrong. But OK, I'll try:
>seemingly relevant part of the first post is the following:

Look at top of page and you will find the answer to "What part of my
argument is wrong?"

>
>"pointer can point almost anywhere: to any char, or to any contiguous
>array of chars"

This a toal condraction to what you said at top of the page.

>
>Even the very words I quoted do not say that said pointer __is__ a
>pointer to an array. They merely say that pointer __points__ to said
>array, and that is, sadly, somewhat imprecise. Lack of precision is
>not normally relevant, but OK, you insist. So... The explanation I
>offered shows various facets of the issue better.
>
>(At the danger of repeating myself...) What __might happen__ is that
>pointer points to a place in memory where there's several instances of
>type, one after another. When that is the case, indexing the pointer
>produces same result as if pointer was an array and we were indexing
>the array. But this is where the buck stops. What you seem to be doing
>is the following logic leap: when pointer points to the first element
>of an array, it __is__ a pointer to an array. That is strictly not
>true. Elsewhere people did show what "pointer to an array" is, that's
>not in any way unclear.


Sorry I don't know what you are talking about, and neither do you by the
looks of things.

 
Reply With Quote
 
Drew Lawson
Guest
Posts: n/a
 
      03-25-2011
In article <(E-Mail Removed)>
Goran <(E-Mail Removed)> writes:
>On Mar 25, 3:32*pm, "Paul" <(E-Mail Removed)> wrote:
>> "Goran" <(E-Mail Removed)> wrote in message
>>
>> --No. I think I offered a reasonable analysis and a correct explanation.
>> --Please, where am I wrong?
>>
>> Top of page

>
>I can't see how top of page shows me wrong. But OK, I'll try:


Might I suggest that you don't.

My experience as a viewer of The Paul Show is that he throws out
intentionally vague or crypticly phrased objections with full
knowledge that they cannot be unambiguously answered. Any attempt
will be stamped as wrong, again without any detail as to what his
objection is.

It is a game that is briefly amusing when played with a 4 year-old.

Of course, on the occasions that Paul makes the mistake of stating
a specific objection, someone responds with a specific and detailed
rebuttal. This results in Paul calling the poster an idiot.

He isn't here to learn. He's here to see how long people will jump
like cats when he wiggles a feather toy.


--
|Drew Lawson | Of all the things I've lost |
| | I miss my mind the most |
 
Reply With Quote
 
Paul
Guest
Posts: n/a
 
      03-25-2011

"Drew Lawson" <(E-Mail Removed)> wrote in message
news:imirhg$7m4$(E-Mail Removed)...
> In article
> <(E-Mail Removed)>
> Goran <(E-Mail Removed)> writes:
>>On Mar 25, 3:32 pm, "Paul" <(E-Mail Removed)> wrote:
>>> "Goran" <(E-Mail Removed)> wrote in message
>>>
>>> --No. I think I offered a reasonable analysis and a correct explanation.
>>> --Please, where am I wrong?
>>>
>>> Top of page

>>
>>I can't see how top of page shows me wrong. But OK, I'll try:

>
> Might I suggest that you don't.
>
> My experience as a viewer of The Paul Show is that he throws out
> intentionally vague or crypticly phrased objections with full
> knowledge that they cannot be unambiguously answered. Any attempt
> will be stamped as wrong, again without any detail as to what his
> objection is.
>
> It is a game that is briefly amusing when played with a 4 year-old.
>
> Of course, on the occasions that Paul makes the mistake of stating
> a specific objection, someone responds with a specific and detailed
> rebuttal. This results in Paul calling the poster an idiot.
>
> He isn't here to learn. He's here to see how long people will jump
> like cats when he wiggles a feather toy.
>
>
> --
> |Drew Lawson | Of all the things I've lost |
> | | I miss my mind the most |
>


Interesting theory.
You should be an online phycologist, analysing people without even seeing
them is obviously one of your traits


 
Reply With Quote
 
Drew Lawson
Guest
Posts: n/a
 
      03-26-2011
In article <(E-Mail Removed)>
cg_chas <(E-Mail Removed)> writes:
>
>I see
>no problem with people correcting the C++ related things that he says.


I agree. We disagree on whether it will have any benefit.

But the only harm is encouraging a troll, and this one seems to
require little encouragement.

--
Drew Lawson | What you own is your own kingdom
| What you do is your own glory
| What you love is your own power
| What you live is your own story
 
Reply With Quote
 
Michael Tsang
Guest
Posts: n/a
 
      04-02-2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul wrote:

> <quote ref: http://c-faq.com/aryptr/aryptr2.html >
> The array declaration char a[6] requests that space for six characters be
> set aside, to be known by the name ``a''. That is, there is a location
> named ``a'' at which six characters can sit. The pointer declaration char
> *p, on the other hand, requests a place which holds a pointer, to be known
> by the name ``p''. This pointer can point almost anywhere: to any char, or
> to any contiguous array of chars, or nowhere
> </quote>
>
> I have found many other texts by the likes of Bjarne Stroustrup and many
> other highly respected C+ authorities that is in agreement with the above.
> So how can it be that the majority of this newsgroup disagree with all
> these experts?
> Are these experts somehow incorrect?


p is a pointer to char, *not* a pointer to *array* of char

char (*q)[6] = &a; *is* a pointer to *array* of char
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk2XNKsACgkQZ1Turg5KUCm3cQCeLa3nRje2Wf S4VplZw+5vW+xf
OHIAn1vUNmnZGu+PtpnBhbz7yv6aCBVD
=JiKr
-----END PGP SIGNATURE-----

 
Reply With Quote
 
Paul
Guest
Posts: n/a
 
      04-02-2011

"Michael Tsang" <(E-Mail Removed)> wrote in message
news:in7cbh$1sm$(E-Mail Removed)...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Paul wrote:
>
>> <quote ref: http://c-faq.com/aryptr/aryptr2.html >
>> The array declaration char a[6] requests that space for six characters be
>> set aside, to be known by the name ``a''. That is, there is a location
>> named ``a'' at which six characters can sit. The pointer declaration char
>> *p, on the other hand, requests a place which holds a pointer, to be
>> known
>> by the name ``p''. This pointer can point almost anywhere: to any char,
>> or
>> to any contiguous array of chars, or nowhere
>> </quote>
>>
>> I have found many other texts by the likes of Bjarne Stroustrup and many
>> other highly respected C+ authorities that is in agreement with the
>> above.
>> So how can it be that the majority of this newsgroup disagree with all
>> these experts?
>> Are these experts somehow incorrect?

>
> p is a pointer to char, *not* a pointer to *array* of char
>


As the experts have said p can point almost anywhere. You are obviously
another thicko if you cannot understand the basics of pointers.

 
Reply With Quote
 
hanukas
Guest
Posts: n/a
 
      04-02-2011
On Apr 2, 6:15*pm, "Paul" <(E-Mail Removed)> wrote:
> "Michael Tsang" <(E-Mail Removed)> wrote in message
>
> news:in7cbh$1sm$(E-Mail Removed)...
>
>
>
>
>
>
>
>
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1

>
> > Paul wrote:

>
> >> <quote ref:http://c-faq.com/aryptr/aryptr2.html>
> >> The array declaration char a[6] requests that space for six charactersbe
> >> set aside, to be known by the name ``a''. That is, there is a location
> >> named ``a'' at which six characters can sit. The pointer declaration char
> >> *p, on the other hand, requests a place which holds a pointer, to be
> >> known
> >> by the name ``p''. This pointer can point almost anywhere: to any char,
> >> or
> >> to any contiguous array of chars, or nowhere
> >> </quote>

>
> >> I have found many other texts by the likes of Bjarne Stroustrup and many
> >> other highly respected C+ authorities that is in agreement with the
> >> above.
> >> So how can it be that the majority of this newsgroup disagree with all
> >> these experts?
> >> Are these experts somehow incorrect?

>
> > p is a pointer to char, *not* a pointer to *array* of char

>
> As the experts have said p can point almost anywhere. You are obviously
> another thicko if you cannot understand the basics of pointers.


char *name = "Paul";
char *p = name;

Now p is a pointer to idiot.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Have I bought wrong product? enquirer Wireless Networking 2 06-10-2005 10:59 PM
Zero Config keeps connecting to the wrong AP =?Utf-8?B?ZGdyaWZmaXRo?= Wireless Networking 2 03-04-2005 05:52 PM
Is XML Doc wrong or is Schema wrong? (or both) Matthew XML 7 01-07-2005 10:05 PM
wrong connection status Peter Welk Wireless Networking 0 12-22-2004 03:26 PM
XP SP2 Wrong IP on connection D Wells Wireless Networking 3 12-09-2004 03:35 AM



Advertisments