Guile Mailing List Archive

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

Casting a pointer to a structure



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


Guile Home | Main Index | Thread Index