hello , does any one know how to write wide chars to a file using i/o
[C/win32 api]
thanks
hello , does any one know how to write wide chars to a file using i/o
[C/win32 api]
thanks
Using winapi, you would open a file for writing with CreateFile and use WriteFile to write to it. Just make sure that the nNumberOfBytesToWrite parameter of WriteFile is set to sizeof(TCHAR)*number_of_TCHARs_to_write (UNICODE defined!) or, sizeof(WCHAR) if you explicitly need to use that type. Don't forget to CloseHandle on the file when you're done.
Here's the file io api functions; ReadFile is for reading. You may also be interested in IsTextUnicode if you're intending reading these wide char files you're writing.
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.
You could also use Standard C File I/O routines if you want.
Notice that all the character and string I/O routines have a wide, uincode version as well. For example, fwprintf() and fwscanf().
gg