all:
In C language:
struct A
{
int a;
int b;
};
A aa = {0};
This statement initialize aa.a only or initialize the whole struture? Or the behavior depends on Compiler?
Thanks in advance!
One more ex:
struct A
{
int a;
int b;
};
struct A aa = {5};
This will initialize the whole structure but aa.b will be initialized to 0. If you initialize only few members of a structure then all other members of that will be automatically initialized to 0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With