int vsprintf(char* cpBuffer, const char* kcpFormatString, va_list qVarArgList);
#include <cstdio>
#include <cstdarg>
void PutArgsInBuffer(char* cpBuffer, char* cpFormat, ...)
{
va_list qVarArg = 0;
va_start(qVarArg, cpFormat);
// Put the arguments into the buffer
vsprintf(cpBuffer, cpFormat, qVarArg);
va_end(qVarArg);
}
int main()
{
char caBuffer[100];
PutArgsInBuffer(caBuffer, "%s %d", "XoaX.net", 2009);
printf("Buffer Holds: %s\n", caBuffer);
return 0;
}
© 20072024 XoaX.net LLC. All rights reserved.