Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #142572
| From | Ike Naar <ike@iceland.freeshell.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Array-as-pointer Syntax |
| Date | 2019-03-28 22:59 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <slrn3m0sq9qkf0.hru.ike@iceland.freeshell.org> (permalink) |
| References | <761347c7-4f03-42f3-a156-5f357c8ae091@googlegroups.com> <gg4e83Far11U15@mid.individual.net> <ceac71f4-9948-47a9-a96f-26acdb272b61@googlegroups.com> |
On 2019-03-28, James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
> On Thursday, March 28, 2019 at 1:23:26 PM UTC-4, Ian Collins wrote:
>> On 29/03/2019 06:04, David T. Ashley wrote:
>> > Given:
>> >
>> > int x[1000];
>> >
>> > what is the difference between:
>> >
>> > memset(x, 0, sizeof(x));
>> >
>> > and
>> >
>> > memset(&x, 0, sizeof(x));
>> >
>> > I would think there is NO difference, but I might be missing something ...
>>
>> Check for yourself!
>>
>> #include <stdio.h>
>>
>> int main()
>> {
>> int x[111];
>> printf( "%p %p\n", x, &x);
>
> Not quite correct. When you pass a %p format specifier to printf(), "The
> corresponding argument "shall be a pointer to a pointer to void."
> (7.21.6.2p12).
I think the pointer-to-pointer-to-void is for *scanf.
For *printf it's pointer-to-void.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Array-as-pointer Syntax "David T. Ashley" <dashley@gmail.com> - 2019-03-28 10:04 -0700
Re: Array-as-pointer Syntax Bart <bc@freeuk.com> - 2019-03-28 17:18 +0000
Re: Array-as-pointer Syntax David Brown <david.brown@hesbynett.no> - 2019-03-28 21:31 +0100
Re: Array-as-pointer Syntax Ian Collins <ian-news@hotmail.com> - 2019-03-29 06:23 +1300
Re: Array-as-pointer Syntax James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-03-28 12:09 -0700
Re: Array-as-pointer Syntax Ian Collins <ian-news@hotmail.com> - 2019-03-29 08:21 +1300
Re: Array-as-pointer Syntax Ike Naar <ike@iceland.freeshell.org> - 2019-03-28 22:59 +0000
Re: Array-as-pointer Syntax James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-03-28 17:44 -0700
Re: Array-as-pointer Syntax Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-28 20:12 +0000
Re: Array-as-pointer Syntax James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-03-28 11:57 -0700
Re: Array-as-pointer Syntax Keith Thompson <kst-u@mib.org> - 2019-03-28 13:57 -0700
Re: Array-as-pointer Syntax James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-03-28 19:50 -0400
Re: Array-as-pointer Syntax Keith Thompson <kst-u@mib.org> - 2019-03-28 14:04 -0700
Re: Array-as-pointer Syntax John Bode <jfbode1029@gmail.com> - 2019-03-29 07:24 -0700
Re: Array-as-pointer Syntax Ike Naar <ike@iceland.freeshell.org> - 2019-03-29 18:08 +0000
csiph-web