answersLogoWhite

0

How is a structure different from an array?

Updated: 8/19/2019
User Avatar

Wiki User

12y ago

Best Answer

A structure can contain attributes which can be used an manipulated, but is an instance of itself, where an array contains multiple points of data storage which can be accessed and manipulated.

Imagine an array as a wine rack: it contains many places which can be used to fit the specific type of variable (for a wine rack, it will really only take wine), with the amount of spaces defined before it is made.

Imagine a structure as an object: it contains attributes which are intrinsic of the object and attributes which can edited, manipulated and visualised.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How is a structure different from an array?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why array is differ from structure?

An array is an aggregate of the same type. A structure is an aggregate of different types.


Is array is structure or not?

Array is not a struct. Array only has one datatype, struct has arbitrary different datatypes.


What distinguishes an array from a structure?

Am array is an aggregate of elements that must be of the same type. A structure is an aggregate of elements (members) that can be of different types.


What is the difference between an array and structure?

An array is a collection of related data elements of same type.Structure can have elements of different types.An array is a derived data type.A structure is a programmer-defined data type.A struct can contain multiple data types, whereas an array can not.


What is difference between structure and array?

An array is a made up of elements of the same type e.g. strings or integers. A structure on the other hand can be made up of elements of different types.


What is the difference between an array of structures and an array within a structure?

The main differences between an array and a structure are: An Array is a collection of similar data items.An array is derived data type.It behave like a built in data type. An array can be increased or decreased. A structure is a collection of dissimilar data items.It is a user defined data types.It must be declared and defined.A structure element can be added if necessary.


Is array structure union is a collection of homogeneous type of data element?

They is three different things.


What is meant by array with in structure in c language?

It means a structure has a member that is an array: typedef struct foo { int x[42]; // an array of 42 integers // other members... };


How does structure differ from an array?

structure is a collection of dissimilar datatypes whereas array is collection of similar datatypes.....


How 2 write c code of array data structure?

An example: int array [10]; yaaa this is write but for a simple programs on array and all data structure visit codingdatastructure.blogspot.com


What was the first historical data structure?

Array


If structure is arraythen an individual array element can be accessed by writing a variable?

A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.