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
How many types of arrays are there in c?
How can you invoke another program from within a C program?
How can you be sure that a program follows the ANSI C standard?
What is the purpose of realloc()?
What are header files and what are its uses in C programming?
What are the advantages of using Unions?
Can we declare function inside main?
Is main is a keyword in c?
Explain how do you generate random numbers in c?
i want to know the procedure of qualcomm for getting a job through offcampus
What is sizeof in c?
Is it better to use malloc() or calloc()?
What is the purpose of type declarations?
What are 3 types of structures?
What is union and structure in c?