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
which is an algorithm for sorting in a growing Lexicographic order
How can I find the modification date and time of a file?
Who developed c language and when?
Why isn't any of this standardized in c? Any real program has to do some of these things.
What is the difference between pure virtual function and virtual function?
How are structure passing and returning implemented?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
Do variables need to be initialized?
Explain what is meant by high-order and low-order bytes?
Explain a pre-processor and its advantages.
Why should I use standard library functions instead of writing my own?
When should a far pointer be used?
What are valid signatures for the Main function?
What is c variable?
What is a macro?