can someone tell me how to INITIALIZE array of structures? i mean like this
Code:
struct appointments appo[24] = {'\0',0,0};
so how can i initialize all appo[0] through appo[23] with the SAME initialization?
thanks.
|
Contributor
|
|
| 12Dec2011,20:11 | #1 |
|
Dear all,
can someone tell me how to INITIALIZE array of structures? i mean like this Code:
struct appointments appo[24] = {'\0',0,0};
so how can i initialize all appo[0] through appo[23] with the SAME initialization? thanks. |
|
Mentor
|
![]() |
| 13Dec2011,04:14 | #2 |
|
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)); |