#include <stdio.h>
#include <stdarg.h>
char buffer[80];
int vspfunc(char *format, ...) {
va_list aptr;
int ret;
va_start(aptr, format);
ret = vsprintf(buffer, format, aptr);
va_end(aptr);
return(ret);
}
int main () {
int i = 5;
float f = 27.0;
char str[50] = "tutoriaspoint.com";
vspfunc("%d %f %s", i, f, str);
printf("%s/n", buffer);
return(0);
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/265228.html