For this exercise, you'll want to demonstrate the output for each part to get full credit. If completed during class, demonstrate to the instructor. Otherwise, save and email screenshots of each one (or just one if all runs can be displayed all at once).
printfstatements to make the addresses line up (like if they were in a table), right-justified.
printfsection in Dive Into Systems.
freeand recompile. Does the program still work?
pas in ptr-examples.c
free? Why or why not? Try it and see what happens!
One thing to learn from the exercise is this: using the
-Wall option to gcc can save us some grief by flagging uninitialized pointer variables for us. ALWAYS USE