Arrays Vs Structures

Both the arrays and structure are classified as structured data types as they provide a mechanism that enable us to access and manipulate data in a relatively easy manner.But they differ in a number of ways.
1.An array is a collection of related data elements of same type.Structure can have elements of different types.
2.An Array is derived data type whereas a structure is a programmer-defined one.
3.Any array behaves like a built-in data type.All we have to do is to declare an array variable and use it.But in the case of a structure,first we have to design and declare a data structure before the variables of that type are declared and used.

No comments:

Post a Comment

Analysis of Discrete-time Linear-Invariant Systems

we shall demonstrate that such systems are characterized in the time domain simply by their response to a unit sample sequence.we shall als...