Description
First parameter in wcstombs() and mbstowcs() can be NULL, in this case functions returns the number of characters that would result from conversion.
char rosStr[BUFFER_SIZE] = "Reactos"; |
cnt = mbstowcs(NULL,rosStr,BUFFER_SIZE); |
...
|
wchar_t rosStr[BUFFER_SIZE] = L"Reactos"; |
cnt = wcstombs(NULL,rosStr,BUFFER_SIZE); |
Example available here:
https://github.com/pechenkin/mailslotBug/blob/master/conversionBug.c