How does the initialization happen in cases 2, 3, 4, 5 below. 1 will contain garbage.
char x[16];
char x[16] = {0};
char x[16] = {0, };
char x[16] = {1};
char x[16] = {1, };
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.
If you use the brace initializer syntax with arrays, any additional elements not mentioned in the initializer list are initialized with zeros.