what is difference between array and structure?
Answer Posted / vinay
Array -
* Memory (array size) is fixed
* Accessing an element in array takes constant time. E.g. -
5th element in an array can be accessed as array[4] i.e.
searching/accessing an element in array takes comparatively
less time than in structures.
* Adding/deleting an element in the array is comparatively
difficult since the data already present in the array needs
to be moved
Structure -
* Memory (structure size) can be changed dynamically
* Accessing an element in a list takes more time
comparatively since we need to traverse thro the list
* Adding/deleting takes less time than in arrays
| Is This Answer Correct ? | 208 Yes | 28 No |
Post New Answer View All Answers
What is the difference between malloc calloc and realloc in c?
What is the use of pointers in C?
How to define structures? ·
What is static and auto variables in c?
What is wild pointer in c?
What does nil mean in c?
What is #line used for?
What is pointers in c?
How is a pointer variable declared?
Tell me what are bitwise shift operators?
What is the difference between #include and #include 'file' ?
What is atoi and atof in c?
What does static variable mean in c?
write a program to find out prime number using sieve case?
What is the sizeof () operator?