1. double * p = (double *) malloc(sizeof(double)); *p = 7.0 2. The correct answer is (b). (a) is wrong because we do not use #define. Also, it is missing the final semi-colon. (c) is wrong for oh, so many reasons! (d) looks like at attempt to assign values, but the question clearly states you are defining the structure, not assigning values. (It also assigns values wrong.) 3. FALSE Although this code would compile and run, it does not do what the question asked. First, it does not use *dynamic memory allocation*; it just assigns a pointer that points to the object created as p1. Second, it does not create TWO Point objects, as specified; there is only one object here; p1 is a regular reference to it and p2 is a pointer to it -- just one object. 4. The correct answer is (d). (a) is wrong because it uses the keyword "struct" in front of the variable names. You only use "struct" in front of the name of the type (i.e. "Point" in this question). Also, it fails to use proper syntax for accessing the "x" member of the p2 *pointer*. (b) is correct for p1, but wrong for p2. This code attempts to dereference "x", not p2!! But x is a double, not a pointer. In any case, "x" is just a member name; even if it were a pointer, the name is still "x", not "*x". You can't place a * after the "." operator like this. If you want to dereference the pointer first, you need this: (*p2).x = 12.1. (c) is wrong firstly because p1 is not a pointer, so you can't dereference it; secondly it uses two dereferences for p2 when only one is needed; and thirdly it doesn't place parentheses around the p1 or p2 variable names, so in fact it is trying to dereference the "x" member of the structures, which will fail because "x" is a double, not a pointer. (d) properly uses the -> member reference operator for pointers. It could also have used: (*p2) = 12.1. 5. The correct answer is (b). (a) is wrong because malloc() only takes a SINGLE parameter, the total number of bytes you wish to allocate. (c) is wrong because it is not dynamic memory allocation. It correctly allocates a 2-D matrix of chars on the STACK; but the question specifically asked for a DYNAMIC array (i.e. one that is placed on the HEAP). (d) looks like a combination between (a) and (c), and is way off the mark. 6. TRUE Although we often think of structures as being like funky arrays, the analogy breaks down when we are passing them as parameters or return values. In these cases all of their members are COPIED, like normal "primitive" variables (and unlike arrays, which are pointers). Of course, if you pass a *pointer* to a structure, then it behaves more like an array, and the members of the structure are not copied. But the question specifically ruled out the user of the pointer.