WChar_t set to null in C++ -
i have variable in wchararray form. want empty array , reuse it. how can set variable null?
filename[1024] = l'\0';
is way empty array?
you can use std::fill fill array zeros.
std::fill(filename, filename+1024, 0); if have c++11 better use std::begin , std::end iterators call.
std::fill(std::begin(filename), std::end(filename), 0); to initialize first time can use initializer. default value wchar_t 0 there's no need give values in brackets.
wchar_t filename[1024] = {};
Comments
Post a Comment