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.c
if you have not done so already. -
Add
#include "array_list.h"
at the top ofarray_list.c
so 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 (NULL
for pointers,0
for boolean integers). -
Once all the functions have been sufficiently defined, attempt to compile
test_array
by runningmake test_array
. Fix any issues and repeat untiltest_array
builds. -
Run
test_array 0 -1
and 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
.