#include <stdio.h>
struct mystruct {
struct mystruct* next;
};
void f(int a, char c, char* s, struct mystruct* b, ...){
void** varg = (void*)&b;
varg++;
while(*s){
if(*s != '%')
printf("%c", *s++);
else {
s++;
switch(*s) {
case '%':
s++;
printf("%%");
break;
case 's':
s++;
printf("%s", *varg++);
break;
case 'd':
s++;
printf("%d", *varg++);
break;
case 'c':
s++;
printf("%c", *varg++);
break;
default:
break;
}
}
}
}
int main(void){
struct mystruct* b;
f(2, 'c', "How old are you?\n %d %s %d %c %s", b->next, 3,
"Hello, ", 4, 'F', "World!\n");
}