This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
Casting a pointer to a structure
- To: guile@cygnus.com
- Subject: Casting a pointer to a structure
- From: Jost Boekemeier <jostobfe@calvados.zrz.TU-Berlin.DE>
- Date: 19 Jul 1999 20:48:28 +0200
- References: <199907180151.UAA04587@savonarola.red-bean.com>
Hi,
does anyone know if it is possible to cast a pointer to
a structure into a pointer to the first element of a substructure?
For example:
struct env_funcs {
int something;
}
struct x {
struct *env_funcs;
int something;
}
struct m {
struct x x;
int something;
}
Now is it possible to cast a pointer to m into a pointer to a pointer
to struct env_funcs? I know that it is possible to cast a pointer
to the first element of a structure into a pointer to the whole structure
but the above construct surprised me.
Jost