int fwprintf(FILE* qpStream, const wchar_t* kwpFormatString, ...);
#include <iostream> #include <cwchar> int main() { using namespace std; char* cpFileName = "XoaX.txt"; FILE* qpFile = fopen(cpFileName, "a"); // Check that the file could be opened if (!qpFile) { cout << "Could not open the file!" << endl; return 1; } // Output Pi in decimal fixed point format with two // digits after the decimal point. int iReturn = fwprintf(qpFile, L"\nPi = %.2f", 3.14159); // Check whether the write was successful. if (iReturn < 0) { cout << "Write error!" << endl; } fclose(qpFile); return 0; }
© 20072024 XoaX.net LLC. All rights reserved.