J
Jack Klein
But I believe it's true that a pointer to a struct can be freely
converted to and from a pointer to the first element of that struct?
It can be converted, with a suitable cast. There are no automatic
conversions between pointers to objects of different types with the
exception of pointer to void. A pointer to any object type may be
converted to pointer to void without a cast, and vice-versa.
Since a structure cannot contain an instance of itself, the first
member of that struct is some other type of object. Therefore a cast
is always required to convert between a pointer to a struct and a
pointer to its first member.
--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html