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

What are external variables in c?

528


What is d scanf?

575


any "C" function by default returns an a) int value b) float value c) char value d) a & b

656


What is pass by value in c?

581


What are preprocessor directives in c?

624






Is c easy to learn?

548


What are local variables c?

535


Can you think of a logic behind the game minesweeper.

1991


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

626


When should volatile modifier be used?

536


What is dynamic variable in c?

551


Mention four important string handling functions in c languages .

611


Explain what standard functions are available to manipulate strings?

597


What is pointer & why it is used?

585


What is an expression?

646