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


Please Help Members By Posting Answers For Below Questions

code for quick sort?

1845


Define circular linked list.

815


How can I discover how many arguments a function was actually called with?

872


What is dynamic variable in c?

825


Why static variable is used in c?

805


Are bit fields portable?

934


How can you find the exact size of a data type in c?

811


How can I read a binary data file properly?

866


How will you write a code for accessing the length of an array without assigning it to another variable?

851


to find the closest pair

2099


What is assignment operator?

845


Why is sizeof () an operator and not a function?

796


Explain what are compound statements?

842


How will you delete a node in DLL?

968


What is meant by int main ()?

973