Subject: MP1 (This message is being sent to all CPSC 102 Sec 1 students ) A student asks: So how do I refer to tpln in other function? --------------------- Dr. Westall was unclear on the nature of what "other function" meant but assumed it meant functions that were passed a pointer the object_t structure. ---------------------- The student continued: I tried ie " obj->priv->priv->dimension[0] " but I still get the dereferencing warnings and errors, even after casting tpln to void. ----------------------- Dr. Westall sez: Massive pointer chains always lead to MASSIVE DISASTER . Many students (not you) tried this unsuccessfully on the material_getbyname() problem on the midterm. One step at a time wins EVERY TIME ITS TRIED. Assuming obj points to a legit object_t and you declare plane_t *pln; tplane_t *tpln; then pln = (plane_t *)obj->priv; tpln = (tplane_t *)pln->priv; xdim = tpln->dimension[0]; will recover you a correct pointer to the tplane_t and access the x dimension. It is also POSSIBLE to formulate a correct but IMHO simply AWFUL solution using your proposed approach by embedding needed casts and doing something like (this CAN be made to work but I haven't tested this formulation). xdim = (((tplane_t *)((plane_t *)obj->priv)->priv)->dimension[0] Furthermore with my approach I can step through this with gdb and at each step do: print *obj print *pln print *tpln With the cascading pointer "solution" you (AND I) have no clue where it ALL FELL TO PIECES.