How is structure different from an array?

Q8. How is structure different from an array?

Ans. An array can hold multiple elements of same data type whereas a structure can hold multiple elements of different data types.

The component element of an array is referenced by the array name and the index value, for example, NAME[3], FILE[7] etc. On the other hand, the component element of a structure is referenced by the structure name and the element name for example, style.main, check.value etc.

Leave a Reply

Your email address will not be published. Required fields are marked *

73 Views
%d bloggers like this: