Link to home
Start Free TrialLog in
Avatar of ol muser
ol muserFlag for United States of America

asked on

Initialize struct in C

Given struct A, what is the difference between these two initializations?

//begin code

C c1 = {0};

C c2 = {0,};

//end code

Yes, I see some places where they initialize with a zero and a comma.
ASKER CERTIFIED SOLUTION
Avatar of Zoppo
Zoppo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
There is absolutely no difference. The trailing comma is just a syntactic convenience, as alluded by Zoppo.
Avatar of ol muser

ASKER

Thanks
Thanks both