How to use a structure constructor in an array of structures
How to use a structure constructor in an array of structures.?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Feb 18, 2014, 3:37 PM
This is because each element of the struct array is automatically given its default values when the array is created.
Consider, for example, this example:
The output is:
Of course, if you want to give the structs non-default values initially then you can use a struct constructor as in the link which Lakshmanan found.
Lakshmanan Sethu SankaranarayanPosted Feb 18, 2014, 11:52 AM
Please refer the link
http://stackoverflow.com/questions/7079206/how-to-initialize-array-of-struct