array of structures

jose_peeterson's Avatar, Join Date: May 2011
Contributor
Dear all,
can someone tell me how to INITIALIZE array of structures? i mean like this
Code:
struct appointments appo[24] = {'\0',0,0};
this only initializes appo[0] others are not initalized properly.

so how can i initialize all appo[0] through appo[23] with the SAME initialization?

thanks.
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
If you just want to initialise the whole lot to zeros the easiest way is to use memset.
Code:
memset(&appo[0],0,24*sizeof(struct appointments));