what is difference between array and structure?
Answers were Sorted based on User's Feedback
Answer / manish
array is a similar type of data but structure are collection of any type of data
array alway start with 0
e.g.a[5]
in this array 6 element
structure has no diffination
it is a collection of n num any data type
Is This Answer Correct ? | 6 Yes | 2 No |
Answer / abinaya
array:arrray is a collection of similar datatypes stored in
common name.it is a scpe of variable
structure:structure is a dissimilar datatypes stord in
common name.it is a scope of datatype
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / triveni
ARRAY:- array includes same type of data types.
we dont use any keyword while defining array.
array always passed/called by reference to function.
we cant copy one array to another even though both arrays
ae of same type.
it is fixed in size.
structure:-array includes same or differnt data type
elements .
we use struct keyword while definings structure.
by default structure passed/called by value to function.
we cant copy one structure to another if both are of same
struct type and having different variabe names.
it is not fixed in size.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / ajeet
Array is the collection of homogeneous data elements
whereas Structure is the collection of heterogeneous
data types elements.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / karam ali
structure is the collection of the different or may be same data type,,,,but the array is the collection of the same data type,
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / bavithra
Array:Derived datatype
Structure:User defined datatype
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / priya
Array have same data type and static memory allocation....
Structure have different data type and dynamic memory
allocation
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / bilal wazir
arrays are the group of related data types but structure are
the different data items
Is This Answer Correct ? | 2 Yes | 0 No |
ARRAY:
An array is defined as a group of related data items stored by means of a single variable name.
STRUCTURE:
Structure is defined as a data type to represent several different types of data with a single name.
DIFFERENCE BETWEEN ARRAYS AND STRUCTURES:
1.All data in a array should be of same data type.But in structures data can be of different data types.
2.Individual entries in an array are called elements.But in structure individual entries are called members.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / rkv charan
Array:
1.static memory allocation.
2.array size is fixed.
3.array can't have bit fields.
structure:
1.Dynamic memory allocation.
2.structure size is changed dynamically.
3.structure can contain bit fields.
Is This Answer Correct ? | 2 Yes | 0 No |
Can the sizeof operator be used to tell the size of an array passed to a function?
What is the use of ?: Operator?
What is the size of structure pointer in c?
What is the purpose of macro in C language?
Explain bit masking in c?
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
Why we write conio h in c?
suppose we use switch statement and we intilize years name using enum statement like(jan,feb,mar,------dec) we take integer value as an input .question is that the month which we analyz is from 0 to 11 bt if i enter 12 than how he again starts from begning and print jan
how to make program without <> in libray.
What is the best way of making my program efficient?
What is the difference between memcpy and memmove?
Write a C program to check a number even or odd, without using any relational, arithmetic operator and any loops.