This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: To get the size of a member of a struct
- From: Eus <eus at member dot fsf dot org>
- To: Jim Wilson <wilson at tuliptree dot org>
- Cc: GCC Help Mailing List <gcc-help at gcc dot gnu dot org>
- Date: Sat, 19 Apr 2008 00:02:53 -0700 (PDT)
- Subject: Re: To get the size of a member of a struct
- Reply-to: eus at member dot fsf dot org
Hi Ho!
--- Jim Wilson <wilson@tuliptree.org> wrote:
>
> It should work, but may not be the best solution.
>
> Another solution is to define a type you can query, e.g.
>
> typedef char name_t[50];
> and then use this in the struct definition and in the sizeof call.
I think this is good. But, not everyone likes to use typedef, for example, Linus
Torvalds as he mentioned not to use typedef in the Linux kernel coding guideline
:)
> Jim
Best regards,
Eus
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ