Tag Archives: variable arg count

Job interview question: How to get variable arg count for C++ program with va_arg, va_start, and va_end

Job interview question: How to get variable arg count for C++ program with va_arg, va_start, and va_end
Do it with with va_arg, va_start, and va_end

/* va_start example */
#include
#include

void PrintFloats ( int amount, …)
{
int i;
double val;
printf (“Floats passed: “);
va_list vl;
va_start(vl,amount);
for (i=0;i NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!