get length of `wchar_t*` in c++
If you want to know the size of a wchar_t
string (wchar_t *
), you want to use wcslen(3)
:
size_t wcslen (const wchar_t *ws);
Assuming that you want to get the length of null terminated C style string, you have two options:
#include <cwchar>
and usestd::wcslen (dimObjPrefix);
,- or
#include <string>
and usestd::char_traits<wchar_t>::length (dimObjPrefix);
.