Activity - Modular data structures in C
Grab a simplified version of bag module and its test code:
cp -r /thayerfs/courses/22fall/cosc050/workspace/bagsimple .
cd bagsimple/
and work in groups to modify the bag module so it keeps track of the number of items in the bag. You’ll need to modify
struct bag
(to include a counter)bag_new
(to initialize the counter)bag_insert
(to increment the counter)bag_extract
(to decrement the counter)bag_print
(so you can print the counter!)
Compiling
mygcc -o bagsimple bagsimple.c bag.c readlinep.c