int vfprintf(FILE* qpStream, const char* kcpFormatString, va_list qVarArgList);
#include <cstdio> #include <cstdarg> int main() { char* cpFileName = "XoaX.txt"; // Open an ASCII text file for appending. FILE* qpFile = fopen(cpFileName, "a"); // Check that the file was opened successfully. if (!qpFile) { printf("Could not open the file %s\n", cpFileName); return 1; } // An argument list - the first entry is just a count. int iaArguments[] = {2, 10, 20}; va_list qVarArg = 0; va_start(qVarArg, iaArguments[0]); // Use a var arg list to output two integers vfprintf(qpFile, "\n%d %d", qVarArg); va_end(qVarArg); fclose(qpFile); return 0; }
© 20072024 XoaX.net LLC. All rights reserved.