which one is better structure or union?(other than the
space occupied )
Answer Posted / nishit jain
There is no question of which one is better. Both are there
for different functionality. Structures find more usage in
day-today programming, while unions are used less often.
There are examples where structure may not solve the purpose
but unions will work without much effort. Example :
packing-unpacking of data can be done using unions easily.
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
Is it better to use a macro or a function?
Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record
What is the main difference between calloc () and malloc ()?
What is spark map function?
Is there a way to compare two structure variables?
What are reserved words with a programming language?
What does typeof return in c?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
When should the const modifier be used?
Do you know the use of fflush() function?
#include
What is the advantage of a random access file?
What is the correct code to have following output in c using nested for loop?
Why main is not a keyword in c?
What are the advantages of using macro in c language?