Download Pelles C here: http://www.smorgasbordet.com/pellesc/
wcslen((wchar_t*)str))
at the very least, make sure str is a properly terminated wide string (ignoring all other problems with this approach for now).const char* str = "\x41\x00\xa9\x03\x03\x26\x2d\x4e\x3d\xd8\x02\xde\0";
#include <stdio.h>
#include <wchar.h>
int main(void)
{
const char* str = "\x41\x00\xa9\x03\x03\x26\x2d\x4e\x3d\xd8\x02\xde";
printf("wcslen(str) = %zu\n", wcslen((wchar_t*)str));
return 0;
}
wcslen(str) = 15
x64wcslen(str) = 9
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#include <wchar.h>
#pragma comment(lib, "user32.lib")
int main(void)
{
const char* str = "\x41\x00\xa9\x03\x03\x26\x2d\x4e\x3d\xd8\x02\xde";
printf("wcslen(str) = %zu\n", wcslen((wchar_t*)str));
MessageBoxW(0, (wchar_t*)str, L"test", MB_OK);
return 0;
}
QuoteThe windows header files are derived from Pelles C. Pelles C is derived from LCC.
The licensing for Pelles C is that things derived from Pelles C cannot be used commerically.
LCC also doesn't want things to be used commerically, but it has an additional stipulation
that there has to be acknowledgement of use. These header files remain under the Pelles C
and LCC licenses and are not covered by the GNU license that the rest of the runtime library
abides by.
Page created in 0.023 seconds with 13 queries.