Hrrmmm shouldn't those lines be...
Don.Lewis at tsc.tdk.com
Fri Sep 8 18:46:21 UTC 2000
On Sep 7, 6:44pm, Russ Allbery wrote:
} Subject: Re: Hrrmmm shouldn't those lines be...
} > Now, I can memcpy ( array, target, size), or, I can memcpy (
} > &array, target, size ).
} > According to my tired old K&R background, number 2 is wrong..
} > err...sloppy, in C.
} They're defined by the standard as being entirely equivalent in this
} context, and I'm pretty sure that even K&R would have treated them as
I don't think &array was legal K&R. I just tried compiling it with
the SunOS bundled cc, and it whined:
"std.c", line 5: warning: & before array or function: ignored
There are also some differences between &array and array:
sizeof(*(&array)) == sizeof(array)
sizeof(*array) == sizeof(array)
array != (&array)
More information about the inn-workers