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
Why doesnt this code work?
What is assert and when would I use it?
What is typedf?
What is function what are the types of function?
write a program to generate address labels using structures?
What are reserved words with a programming language?
What are the parts of c program?
Compare array data type to pointer data type
How can variables be characterized?
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
What is exit() function?
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
Explain indirection?
Are the variables argc and argv are always local to main?
What is the difference between struct and union in C?