Re: char (*ptr)[]
From: Old Wolf (oldwolf_at_inspire.net.nz)
Date: 02/24/05
- Next message: Emmanuel Delahaye: "Re: newbie question"
- Previous message: Gary Schenk: "Re: Least helpfull news group award goes to:"
- In reply to: Walter Roberson: "Re: char (*ptr)[]"
- Next in thread: Villy Kruse: "Re: char (*ptr)[]"
- Reply: Villy Kruse: "Re: char (*ptr)[]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 23 Feb 2005 18:25:50 -0800
Walter Roberson wrote:
> Old Wolf <oldwolf@inspire.net.nz> wrote:
> >Walter Roberson wrote:
> >> Rafal Dabrowa <rdsbrows@poczts.onet.pl> wrote:
> >> > void f( char (*ptr)[] );
>
> >> In the first, there is a hint to the reader that what is pointed
> >> to is a constant pointer
>
> >Where? I don't see 'const' anywhere.
>
> I said a hint to the reader, not a hint to the compiler.
>
> array[subscript] where array is a variable (rather than an
> expression) implies that the array location is a constant
> far as that block of code is concerneid, so when someone
> takes the trouble to write the extra () and []
You speak as if the () and [] don't make any difference.
char (*ptr)[] is a completely different type to char *ptr[],
and it isn't possible to write it without the [] .
> then they are usually trying to emphasize that what ptr points
> to is a value that is not going to change.
Never heard that one before. Anyway, as you might have gathered
by now, char (*ptr)[] is quite a different kettle of fish to
your average foo[bar] .
- Next message: Emmanuel Delahaye: "Re: newbie question"
- Previous message: Gary Schenk: "Re: Least helpfull news group award goes to:"
- In reply to: Walter Roberson: "Re: char (*ptr)[]"
- Next in thread: Villy Kruse: "Re: char (*ptr)[]"
- Reply: Villy Kruse: "Re: char (*ptr)[]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|