S
S
sddvxd2018-06-26 21:08:31
C++ / C#
sddvxd, 2018-06-26 21:08:31

How to output LPCWSTR string to wofstream?

Hello!
I'm trying to do this:

std::wofstream fout("C:\\cpp\\log.txt", std::ios::app);
        fout << lpExistingFileName << "| перемещение\n";
        fout.close();

0x76329f0 is displayed in log.txt
Then I understand that this is a pointer and do this: The first letter is displayed and I remember that taking the value at the address returns only the first element of the array. Please tell me how can I put the entire line into the stream
fout << *lpExistingFileName << "| перемещение\n";

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2018-06-26
@sddvxd

wstring ws(lpExistingFileName);
fout << ws << L"| перемещение" << endl;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question