Re: Accessing array elements within a structure
On Mon, 16 Jun 2008 10:06:19 -0700, Keith Thompson <kst-u@mib.org>
wrote:
<snip correct and nicely explained diagnosis>
(IQC)YM ULONG_MAX.
<snip rest>
- formerly david.thompson1 || achar(64) || worldnet.att.ne t
On Mon, 16 Jun 2008 10:06:19 -0700, Keith Thompson <kst-u@mib.org>
wrote:
<snip correct and nicely explained diagnosis>
Here's how to print those values:
>
printf("type %ld - file size %lu:\n",
example.type,
(unsigned long)example.fi les[0]);
>
That's for C90, and it also works in C99 (as long as the value of
example.files[0] doesn't happen to exceed ULLONG_MAX). Note that the
>
printf("type %ld - file size %lu:\n",
example.type,
(unsigned long)example.fi les[0]);
>
That's for C90, and it also works in C99 (as long as the value of
example.files[0] doesn't happen to exceed ULLONG_MAX). Note that the
cast is necessary to ensure that the types match exactly (this is one
of the rare cases where a cast is necesssary and appropriate).
>
of the rare cases where a cast is necesssary and appropriate).
>
- formerly david.thompson1 || achar(64) || worldnet.att.ne t
Comment