struct SampleStruct {
int a;
int b;
float c;
double d;
short e;
};
For an array like this, I used to initialize it as below:
struct SampleStruct sStruct = {0};
I would like to know when I declare array of this structure, I thought this will be correct
struct SampleStruct sStructs[3] = {{0},{0},{0}};
But, below also got accepted by the compiler
struct SampleStruct sStructs[3] = {0};
I would like to know the best and safe way and detailed reason why so.