, , , ,

Did you ever wonder how printf() and it’s cousins get away with having a variable list of arguments?

C supports functions with a variable argument list. for more details man va_start. I used that to write a simple but effective logging facility.

You’ll need both:

dm8log.c (view | download)
dm8log.h (view | download)

Usage example in dm8log.c

I wrote this when I was working on CS50’s pset4/hacker4 — Sudoku, for debugging.