Question & Additional Information
 
What is the difference between structure & union?
Add to My IQ
 

 | 
Inappropriate
Answer Title
Answer
A structure is a union in which each defined data type will have its own memory.
Where as in union the highest memory data type will be memory for entire union.Suppose if a float element is intialaised and an int element, the int will be first located on 2 bytes and then the next 2 bytes will be the float.
Question Tag Title
Tags
Question Asked At Title
Asked At
None
Question Job Title
Job Titles


Check out our newest job listings!

Post a Job! $49 for 60 days



Your Name:
Add your comment text
 
Related Questions
Related Questions
Flag this interview question as inappropriate Inappropriate
See Answer

structures can be passed by reference.

they can be returned as pointers.

Create Date
:
Saturday, March 15, 2008
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
All declarations inside a structure are by default public, while all members inside a class are private
Create Date
:
Thursday, April 03, 2008
Tags
:
Asked At
:
None
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
false: arrays are more appropriate for the elements of the same type
Create Date
:
Tuesday, April 01, 2008
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
We can define structure bit field members with Dot operators.
EXAMPLE:

#include <stdio.h>
int main()
{ Struct bit_field
  {  Int x.4; // it allocates only 4 bits to x
     Char C.6; // it allocates only 6 bits to C;
   };
return 0;
}
Create Date
:
Sunday, March 16, 2008
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
with the help of function modules ie., write_messages or format_messages we can store errors.
Create Date
:
Sunday, March 16, 2008
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
They are different. C struct can only contain data while C++ struct can contain functions and access limitation such as public, private etc just as a class (not totally the same as class!).
Create Date
:
Saturday, March 15, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
 
• More Related Questions: