c++ - Initilization of a wchar_t array with wmemset. Does encoding matter? -


how correctly initialize wchar_t array wmemset? should use '\0' or l'\0' ? matter? encoding matter ? (unicode, iso####)

eg

wchar_t arr[20]; wmemset(arr, '\0', sizeof(arr)); 

thank you. (sorry if have made big mistake)

you need use l'' form wchar_t type, although value fits within char (such '\0') automatically converted using usual integer promotions. see character literal or c++ character literals.

it's unclear me code page source interpreted in. safe, it's best use l'\u20ac' or l'\u000020ac' form specify characters outside of ascii character set.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -