Lab 3: Starting Project 1
Goals for this lab
By the time you have completed this lab, you should
- Have an initial version of the array-based implementation of the List completed.
No Lab Pairing
This is not really a lab, but rather an opportunity to require you to start working on project 1. As such, you may not work with a partner on this assignment.
Lab Preparation
Follow the instructions to obtain the project 1 files if you have not done so already. If you started early, you may want to update your test_list.c file.
Implementing array_list.c
-
Create the file
array_list.cif you have not done so already. -
Add
#include "array_list.h"at the top ofarray_list.cso that the implementation is aware of the attributes available instruct List. -
Define all of the functions that are declared in
array_list.h. Your initial definition might simply want to return the “error” value (NULLfor pointers,0for boolean integers). -
Once all the functions have been sufficiently defined, attempt to compile
test_arrayby runningmake test_array. Fix any issues and repeat untiltest_arraybuilds. -
Run
test_array 0 -1and observe any tests that fail. Make the necessary additions/corrections and repeat steps 4 and 5 until all the tests are passed.
Submitting the project
Even though you’re working on project 1, your lab 3 grade will depend on
passing all the tests for the array-based implementation of the List that are
included in test_list.c.