Outputting 'wchar_t*' to an 'ofstream'

后端 未结 2 1508
星月不相逢
星月不相逢 2021-01-04 02:15

I want to output a text to a file via two pointers that I have declared:

wchar_t   *Col1=\"dsffsd\", *Col2=\"sdfsf\";

Here is what I have t

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-04 03:04

    First, use std::wofstream instead of std::ofstream.

    Also, use the L prefix on your text string to indicate that your text is wide character text:

    wchar_t   *Col1=L"dsffsd"
    

提交回复
热议问题