#include<stdarg.h>
#include<stdio.h>
va_list ap;//聲明一個變量參數
char buff[80];
int myprintf(char *format,...)
{ va_start(ap,format);
int num;
num=vsnprintf(buff,sizeof(buff),format,ap);
va_end(ap);
return num;
}
int main()
{ int a=23;float b=23.0011;char c='d';
myprintf("%d %f %c",a ,b,c);
printf("%s",buff);
return 0;
}