what is difference between array,strutter,union and pointers
Answer Posted / shashidhar
array can contain single data type
Structure is collection of different data types
Unions can also contain different data types, but here the
different date types share the same memory within the
computers memory
ex:
==========================
|| ||
==========================
in the above the memory between || || is shared by int,
float, double declarations in a UNION.
where as in struture || || || the memory
declared for int and float and double are different.
which implies memory utilization is better in union.
When you come to pointers, well it can point to a data type
(like int) can point to a structure (struct xyz{ };) , it
can point to a union (union item { }; ) so its like a honey
BEE it can sit on anything
Is This Answer Correct ? | 54 Yes | 9 No |
Post New Answer View All Answers
code for quick sort?
Define circular linked list.
How can I discover how many arguments a function was actually called with?
What is dynamic variable in c?
Why static variable is used in c?
Are bit fields portable?
How can you find the exact size of a data type in c?
How can I read a binary data file properly?
How will you write a code for accessing the length of an array without assigning it to another variable?
to find the closest pair
What is assignment operator?
Why is sizeof () an operator and not a function?
Explain what are compound statements?
How will you delete a node in DLL?
What is meant by int main ()?