WCHAR wszFoo[CONSTANT_BAR] = {0};
I’ve never seen something like {0} used in C++ as part of the language. And I have no idea how to search for a question like this online. What is it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
$8.5.1/7 –
All this means, is that there is an explict request to initialize first element to 0. Since initializers are not specified for the remaining elements, they are value-initialized. This in case of WCHARs means are initialized to 0.
What does value initialized means? Here is what the Standard says in $8.5 (italics are mine)