#wprintf and %s for substrings
31 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
;compile c++
A
dafuq
hold on, godbolt doesn't run windows
when I tried this it still prints ABCD
You can probably use std::substr
And the first argument should be a wstring
that is a heap allocated copy, I want to skip that
not to mention that if this wstring has \0 in it, wprintf needs to use fixed length to print all the characters
and not %s
you mean std::wcout
Whats the actual issue here?
Yeah, it was a typo
and yes std::wcout<<std::wstring(wchar_ptr, wchar_len)<<L"\n" works just fine
std::wcout.write(arrRef, 1)<<L"\n";
this thing works thank god
it prints
A
maybe I should wipe all of the printf nonsense away from my program (copied from MSDN meant to be used in C) and use wcout
but still this doesn't explain why wprintf is broken
https://stackoverflow.com/questions/17700797/printf-wprintf-s-s-ls-char-and-wchar-errors-not-announced-by-a-compil
yoooooooo what the fuuuuuuuuuuuuuuuu
I am using minGW g++
I does though sometimes.
bump