what is difference between array and structure?

Answer Posted / chaudhary paresh

- Array elements are homogeneous. Structure elements are of
different data type.
- Array allocates static memory and uses index / subscript
for accessing elements of the array. Structures allocate
dynamic memory and uses (.) operator for accessing the
member of a structure.
- Array is a pointer to the first element of it. Structure
is not a pointer
- Array element access takes less time in comparison with
structures.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How #define works?

614


What is the difference between new and malloc functions?

576


What is the correct declaration of main?

677


What are pointers? Why are they used?

628


What is integer constants?

618






Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

2609


What are pointers?

632


What is hashing in c language?

613


What will the code below print when it is executed?   int x = 3, y = 4;         if (x = 4)                 y = 5;         else                 y = 2;         printf ("x=%d, y=%d ",x,y);

1357


What is data structure in c programming?

572


How can I ensure that integer arithmetic doesnt overflow?

606


When a c file is executed there are many files that are automatically opened what are they files?

594


Can an array be an Ivalue?

664


What is typedef example?

616


What are 3 types of structures?

594