[farther OT] Re: Why Is Escaping Data Considered So Magical?
Mel
mwilson at the-wire.com
Thu Jul 1 11:36:46 EDT 2010
Nobody wrote:
> On Wed, 30 Jun 2010 23:40:06 -0600, Michael Torrie wrote:
>> Given "char buf[512]", buf's type is char * according to the compiler
>> and every C textbook I know of.
References from Kernighan & Ritchie _The C Programming Language_ second
edition:
> No, the type of "buf" is "char [512]", i.e. "array of 512 chars". If you
> use "buf" as an rvalue (rather than an lvalue), it will be implicitly
> converted to char*.
K&R2 A7.1
> If you take its address, you'll get a "pointer to array of 512 chars",
> i.e. a pointer to the array rather than to the first element. Converting
> this to a char* will yield a pointer to the first element.
K&R2 A7.4.2
Mel.
More information about the Python-list
mailing list