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
Write a program to print numbers from 1 to 100 without using loop in c?
Explain continue keyword in c
What is volatile variable in c with example?
write a program to generate address labels using structures?
Can we add pointers together?
How can you determine the maximum value that a numeric variable can hold?
How can I read data from data files with particular formats?
How would you rename a function in C?
What is the stack in c?
What is a global variable in c?
Give differences between - new and malloc() , delete and free() ?
Why is c called "mother" language?
What is header file definition?
Is fortran faster than c?
Linked lists -- can you tell me how to check whether a linked list is circular?