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 preprocessor directives?
Do variables need to be initialized?
Simplify the program segment if X = B then C ← true else C ← false
Explain the use of bit fieild.
Describe how arrays can be passed to a user defined function
In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
When should a far pointer be used?
What is pointers in c with example?
When should you use a type cast?
Did c have any year 2000 problems?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
What is the purpose of sprintf() function?
Write a program to find the biggest number of three numbers in c?
Do you know the purpose of 'register' keyword?