Tips for Next Week's Lab
Memory management, Linked lists
- Concatenate all command line arguments into a string on the heap
- allocate sufficient space using
malloc()
- always cast the result of
malloc()
char *heap = (char *)malloc( ... )
|
- always free memory to avoid memory leaks
- Same tips apply to
heapsum.c
- Linked lists
|