Know how to write a simple struct declaration (like the declaration of "struct point" at the beginning of the reading).
Understand how to declare a variable of a struct type as a part of the struct declaration.
Understand how to declare a variable of a struct type in a separate statement.
Know how to access (read from/write to) the members of a struct.
Accessing a struct's members through a pointer to the struct is
probably even more common than accessing a struct's members
directly. Know how to do this both with and without the structure
pointer operator ("->", also called "arrow"). Also: If you
don't use the arrow operator, are parentheses necessary? In other
words, if pp is a pointer to a structure, is *pp.x okay, or do you need
Know what sizeof does and how to use it on simple types. (Does it work on arrays and structs, too?)
Be able to write (very simple) typedef declarations. (But be aware of the required order in such a statement.)
Using a struct to define nodes for things like trees and linked lists is extremely common and useful in C (and it's something you'll need to do in Assignment 4). Can you write a struct declaration for a node in a simple linked list? (Assume, for example, that the node stores a single int and a pointer to the next node in the list.)
Understand how storage space for dynamically allocated nodes is
obtained by calls to malloc. For example, a malloc call might
look something like this:
Understand what's being passed as an argument to malloc. Why does
the result of malloc need to have its type cast? If memory is
allocated with malloc, how is it deallocated?
struct node *head = (struct node *) malloc(sizeof(struct node));