What is the difference between struct and union in C?



What is the difference between struct and union in C?..

Answer / hrpynux@gmail.com

A struct is a block of memory that stores several data objects, where those objects don't overlap. A union is a block of memory that stores several data objects, but has only storage for the largest of these, and thus can only store one of the data objects at any one time.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

0 Answers  


How can I do peek and poke in c?

0 Answers  


Who is invented by c?

24 Answers   Infosys, Mphasis,


Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.

0 Answers  


What is the most efficient way to store flag values?

0 Answers  






What is property type c?

0 Answers  


whenever a question is posted in a particular category in allinterview.com, Is there any facility to receive an indication mail. For eg: I need to receive an indication email, whenever a question is posted under the category “C Langauage”.

1 Answers  


how to do in place reversal of a linked list(singly or doubly)?

3 Answers  


4) Write a program that takes a 5 digit number and calculates 2 power that number and prints it. i have done maximum par but i m findind problem in the commented area. please help...

3 Answers  


when user give a number it multiply with 9 without useing '+' and '*' oprator

4 Answers  


How to write in a function declaration and in function call in which the function has 'n' number of varible or arguments?

2 Answers  


Can you mix old-style and new-style function syntax?

0 Answers  


Categories