Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

   struct parent *p = (struct child *)c; // valid
Note that this cast would be valid without the MS extensions too, you can always cast a pointer to a struct to a pointer to its first member and viceversa. What the MS extensions allow you to do is to just do `c->i` directly, without having to name the parent


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: