This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]