wchar_t* fgetws(wchar_t* wpString, int iLength, FILE* qpStream);
#include <iostream> #include <cwchar> int main() { using namespace std; char* cpFileName = "XoaX.txt"; FILE* qpFile = fopen(cpFileName, "r"); // Check that the file could be opened if (!qpFile) { wcout << L"Could not open the file" << endl; return 1; } // Read the first string of the file. wchar_t waString[20]; wchar_t* wpReturn = fgetws(waString, 20, qpFile); if (wpReturn != NULL) { // Output the string wcout << L"String read: " << waString << endl; } else { wcout << L"Read Error" << endl; } fclose(qpFile); return 0; }
© 20072024 XoaX.net LLC. All rights reserved.