I am learning stdarg.h in c i am trying to print all arguments passed to function without knowing how many arguments are there but yet i have not come up with solution, during this this happened, no matter what i pass to strtest. It always print 0. 1. 2. 3.
void strtest(char *fmt, ...){
va_list argp;
int i = 0;
va_start(argp, fmt);
while(va_arg(argp, char*))
printf("%d\t", i++ );
va_end(argp);
}
int main(int argc, char *argv[]){
strtest("s");
printf("\n");
return 0;
}