PROJECT DOSSIER // [C POOL — DAY 10]VIEW SOURCEBACK TO PROJECTS →

01 // PROJECT AT A GLANCE

C POOL — DAY 10

C

Automating compilation, and letting the program itself choose the operation.

Two lessons in one day: first, writing the file that describes how to build a project, so you never retype a compilation line again; then building a small calculator that dynamically chooses which operation to run, which is the first encounter with the idea that a function is data too.

Writing a complete Makefile (all, clean, fclean, re) and implementing do_op through a function pointer table.

PRIMARYC
DELIVERYTEAM RECORD
VERIFICATIONmake
SOURCEINSPECTOR READY
MEDIA ATTACHMENTS (Images, Photos, Videos)

03 // KEY OUTCOMES

  • A library Makefile that compiles into objects, archives with ar and installs libmy.a and my.h at the imposed locations
  • A command-line calculator handling malformed operands, division and modulo by zero with imposed messages

BEYOND THE BRIEF

  • A function pointer table rather than a chain of conditionals, a technique not required at this stage

04 // SOURCE TREE

READING SOURCE…