How do I loop through a va_list if the number of additional arguments is unknown?
#include
#include
int add(int x, int y, ...
You must indicate the number of parameters somehow (if you're writing portable code) when using variable length argument lists. You may be now thinking "But printf doesn't require you to indicate a number of arguments!"
True, however the number can be inferred by first parsing the format strings for % format specifiers.