size_t fwrite(const void* kvpBuf, size_t qSize, size_t qCount, FILE* qpStream);
#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 the file %s\n", cpFileName);
return 1;
}
char cpBuffer[] = "\nC++ Reference";
size_t qBytes = 0;
// Write the entire buffer without the null terminator.
qBytes = fwrite(cpBuffer, 1, sizeof(cpBuffer) - 1, qpFile);
printf("Bytes Written = %i\n", qBytes);
fclose(qpFile);
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.