I have the following code
int t[] = {
[1] = 45,
[2] = 33
};
What will be the value of t[0] in this case? It will contains garbage?
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.
The other value(s) will be initialized; from C11 standard, §6.7.9 Initialization, ¶19 and ¶21:
And uninitialized
intwith static storage duration are implicity initialized to zero; same section, ¶10:The behavior is the same in C89 and C99.