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
Explain what are reserved words?
Explain high-order and low-order bytes.
What is calloc()?
Explain how can I right-justify a string?
In which layer of the network datastructure format change is done
What is the most efficient way to count the number of bits which are set in an integer?
Explain output of printf("Hello World"-'A'+'B'); ?
What are the keywords in c?
In a header file whether functions are declared or defined?
What is structure pointer in c?
What does void main () mean?
string reverse using recursion
How a string is stored in c?
c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above
What is c standard library?