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

Write a program to print numbers from 1 to 100 without using loop in c?

870


Explain continue keyword in c

784


What is volatile variable in c with example?

788


write a program to generate address labels using structures?

4299


Can we add pointers together?

824


How can you determine the maximum value that a numeric variable can hold?

906


How can I read data from data files with particular formats?

825


How would you rename a function in C?

817


What is the stack in c?

896


What is a global variable in c?

786


Give differences between - new and malloc() , delete and free() ?

859


Why is c called "mother" language?

1070


What is header file definition?

832


Is fortran faster than c?

791


Linked lists -- can you tell me how to check whether a linked list is circular?

862