Example code:
#include <stdio.h>
typedef struct
{
unsigned int a,
unsigned int b,
unsigned int c
} user_struct;
int main()
{
user_struct arr[5] = {0}; // gives warning on compilation
return 0;
}
The above code gives warnings in gcc5.4 Below is the warning.
warning: missing braces around initializer
My understanding is that, if I want to initialize any object to 0, I can just equate to {0}.
How can I initialize an array of structs to 0 without compiler warning? Thanks.