Lord Isildur wrote: > > sine one knows the size of the struct, who need the pointer? just > take the displacement. > > char* buf; /* some buffer */ > struct foo{ > int header; > struct funkystruct blah; > }; > > (struct foo*)buf; /*your headers are here */ > (struct foo*)buf+1; /* and your data is here */ nice. personally, I still prefer buf[0], because I think it's more readable. It's clear for the reader that the struct will be allocated larger than sizeof(struct foo), while with macro, that's not immediately obvious. btw, anybody can list compilers that reject buf[0] (inside struct)? MS visual C doesn't seem to complain either. > Isildur > thanks, Bennylp To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
- Re: Question regarding the array of size 0. Johan Danielsson
- Re: Question regarding the array of size 0. Julian Elischer
- Re: Question regarding the array of size 0. Todd Whitesel
- Re: Question regarding the array of size 0... Peter Seebach
- Re: Question regarding the array of si... Alfred Perlstein
- Re: Question regarding the array ... Harti Brandt
- Re: Question regarding the ar... Lord Isildur
- Re: Question regarding the ar... John Franklin
- Re: Question regarding the ar... Lord Isildur
- Re: Question regarding the ar... John Franklin
- Re: Question regarding the ar... Benny Prijono
- Re: Question regarding the ar... John Gregor
- Re: Question regarding the ar... Greg A. Woods
- Re: Question regarding the ar... Drew Eckhardt
- Re: Question regarding the ar... Frederick Bruckman
- Re: Question regarding the ar... Peter Seebach
- Re: Question regarding the array ... Peter Seebach
- Re: Question regarding the array of size 0. Johan Danielsson
- Question regarding ifconfig. Shankar Agarwal
- Re: Question regarding ifconfig. Bill Studenmund
- Re: Question regarding the array of size 0. Greywolf