Answers to Type Expressions Practice 2
(Also 09F, practice exam 2, q6)
CS16,P. Conrad, UCSB


The problems that this is an answer key for can be found at the links below:

Expression Type      Expression Type
a int   f->radius double    
&a int *   f->center.x double
*a error   f->center->y error (f->center is not a pointer)
*b int   &g struct Point *
e struct Circle   *h struct Point
b int *   &(h->x) double *
& b int ** d *(h.y) error (h.y is already an error because h is not a struct)
c double   i.m int
*c error (c is not a pointer)   j.d error (j is not a struct)
d double *   i->y error (i is not a pointer)
&d double **   j->m int
*e error (e is not a pointer) er (*j).m int (means same thing as j->m)
e.x error (circle has no member named x)   argc int
e.radius double   argv[0] char *
f.y error (f is not a struct)   argv[0][0] char