Possible Duplicate:
how does array[100] = {0} set the entire array to 0?
how to initialize a char array?
In c++, I want to initialize char array to 0s array.
Will "char a[4096] = {0};" do this?
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.
Yes it will… but keep in mind that a
charbeing0is ASCIINULL… if you want it initialized to all'0'(character 0’s) that won’t work.In this case:
Would be a better way to go… or
Would be better yet.