M
mimi
#include <fstream>
#include "stdio.h"
int main()
{
// std::wofstream strm2("test.txt");
// strm2 << L"ÎÒ°®±±¾©Ìì°²ÃÅ";
FILE *hFile = fopen("test.txt", "wb+");
wchar_t *buffer = L"ÎÒ°®±±¾©Ìì°²ÃÅ";
fwrite (buffer , sizeof(buffer[0]) , 7 , hFile );
fclose (hFile);
return 0;
}
The program works. But how could i use wofstream in STL to write a
unicode string to file? The code above which is commented does not
work.
#include "stdio.h"
int main()
{
// std::wofstream strm2("test.txt");
// strm2 << L"ÎÒ°®±±¾©Ìì°²ÃÅ";
FILE *hFile = fopen("test.txt", "wb+");
wchar_t *buffer = L"ÎÒ°®±±¾©Ìì°²ÃÅ";
fwrite (buffer , sizeof(buffer[0]) , 7 , hFile );
fclose (hFile);
return 0;
}
The program works. But how could i use wofstream in STL to write a
unicode string to file? The code above which is commented does not
work.