int fprintf(FILE* qpStream, const char* kcpFormatString, ...);
#include <cstdio>
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 %s for writing\n", cpFileName);
return 1;
}
// Append the copyright to the file,
// with a decimal number and string
char caBuf[] = "Xoax";
int iReturn = fprintf(qpFile, "\nCopyright %d %s", 2009, caBuf);
if (iReturn < 0) {
printf("Write Error");
}
fclose(qpFile);
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.