#include<stdio.h>
#include <stdarg.h>
#include <iostream>
using namespace std;
#define bufsize 80
char buffer[bufsize];
int vspf(char *fmt, ...)
{
va_list argptr;
int cnt;
va_start(argptr, fmt);
cnt = vsnprintf(buffer,bufsize ,fmt, argptr);
va_end(argptr);
return(cnt);
}
int main(void)
{
int inumber = 30;
float fnumber = 90.0;
char string[4] = "abc";
cout<<vspf("%d %f %s", inumber, fnumber, string)<<endl;
printf("%s
", buffer);
getchar();
return 0;
}