Re: data structure initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Fri, Nov 27, 2009 at 5:56 PM, Bernd Petrovitsch <bernd@xxxxxxxxx> wrote:
On Fri, 2009-11-27 at 17:50 +0530, Anuz Pratap Singh Tomar wrote:
[...]
> I have came across, this kind of structure initialization for the
> first time:
[...]
>         [ICMP_ADDRESSREPLY] = {
>                 .output_entry = ICMP_MIB_OUTADDRMASKREPS,
>                 .input_entry = ICMP_MIB_INADDRMASKREPS,
>                 .handler = icmp_address_reply,
>         },
> };
>
>
> I am not sure what those indexes are for: for example
> [ICMP_ADDRESSREPLY].
You tell the C compiler that the above element should be at index
ICMP_ADDRESSREPLY (which must be a compile-time constant of course and
counting starts with 0 - as always in C).

But why is implicit indexing required, it would anyways be indexed from 0?


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux