C: How does nested braces for array of struct initialization work? -


struct mystruct s[10] = {{0}}; 

this appears initialize array of structs 0. how nested braces syntax work?

any fields not specified initialized zero. here have array of structs. you're initializing first element of array structure initializer initializes first element of structure zero. rest of first structure , rest of array elements 0 too. it's nice idiom.


Comments

Popular posts from this blog

drupal - using views argument in the view tpl.php file -

php - Posting PHPBB Forum Thread/Post info in a website -

php - Add a blog by sending a mail to a certain emailadress -