Re: Pointers
From: Keith Thompson (kst-u_at_mib.org)
Date: 03/12/05
- Next message: Mark F. Haigh: "Re: Please help optimize (and standarize) this code..."
- Previous message: Deniz Bahar: "Re: K&R2 Ex 5-11 : What is it asking for?"
- In reply to: Thomas Stegen: "Re: Pointers"
- Next in thread: Thomas Stegen: "Re: Pointers"
- Reply: Thomas Stegen: "Re: Pointers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 12 Mar 2005 03:09:43 GMT
Thomas Stegen <thomas.stegen@gmail.com> writes:
> Keith Thompson wrote:
>
>> I'll grant you that C's declaration syntax can be confusing. I don't
>> think it's a fatal flaw in the language. If you understand it well,
>> you can use it properly; if you don't, there are ways to avoid the
>> complexity in code you write, and tools to decipher complex
>> declarations in code you read.
>
> I am not saying it is difficult, just that is not as easy and clear
> as it could have been.
>
>> The declaration that was said to be "incorrect" was:
>> char *a, b;
>
> It was
>
> char* a, b;
Ok, but that's effectively identical (as you know).
> That was seen as "incorrect" IIRC.
>
>> It's not "seen as incorrect syntactically" by anyone who understands
>> the language well enough.
>
> My point was that if something is not seen as a flaw in the language
> it should not be considered "incorrect" either. Do you agree on this
> point, (agreeing or disagreeing here has nothing to do with whether
> you think the declaration syntax is flawed or not).
Incorrect in what sense? I don't see the fact that
char* a, b;
declare a as a pointer-to-char and b as a char as a flaw in the
language. Whether that line is (logically) incorrect depends on the
programmer's intent.
-- Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst> San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst> We must do something. This is something. Therefore, we must do this.
- Next message: Mark F. Haigh: "Re: Please help optimize (and standarize) this code..."
- Previous message: Deniz Bahar: "Re: K&R2 Ex 5-11 : What is it asking for?"
- In reply to: Thomas Stegen: "Re: Pointers"
- Next in thread: Thomas Stegen: "Re: Pointers"
- Reply: Thomas Stegen: "Re: Pointers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|