Video Coming Soon...

Created by Zed A. Shaw Updated 2026-11-26 20:48:52
 

WARNING: This exercise needs a full review to match recent changes to C. If you find problems please report them with the bug feature (top right, bug icon).

25: Variable Argument Functions

In C, you can create your own versions of functions like printf and scanf by creating a variable argument function or vararg funtion. These functions use the header stdarg.h, and with them, you can create nicer interfaces to your library. They are handy for certain types of builder functions, formatting functions, and anything that takes variable arguments.

Understanding vararg functions is not essential to creating C programs. I think I've used it maybe 20 times in my code in all of the years I've been programming. However, knowing how a vararg function works will help you debug the programs you use and gives you a better understanding of the computer.

View Source file ex25.c Only

Previous Lesson Next Lesson

Register for From Impostor to Programmer

Register today for the course and get the all currently available videos and lessons, plus all future modules for no extra charge.