T
T
Ternick2020-08-05 21:43:27
C++ / C#
Ternick, 2020-08-05 21:43:27

Why can't I copy the file?

Good day :)
I open the file in binary mode for reading like this:

wstringstream wss;
wifstream wif(basePath, ios::binary);
if (wif.is_open()) {
    wss << wif.rdbuf();
    wif.close();
}

I open the file in binary mode for writing like this:
wofstream wof(tempFileName, ios::binary);
if (wof.is_open()) {
    wof << wss.str().data();
    wof.close();
}

As a result, it writes 3 bytes and that's it.
And the question is, what can binary data from a file be wrapped in so that they can be written to an executable file. {I tried the wchar_t array, it contained about 30 kb of data and it took an extremely long time to compile it.}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question