Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the difference b/w Structure & Union?

Answers were Sorted based on User's Feedback



What is the difference b/w Structure & Union?..

Answer / nakul sharma

Memory allocated for any structure is equal to the sum of
memory required by each structure member.

Example: In a structure 'abc' below, memory allocated will
be 7 Bytes (2 Bytes for int a + 1 Byte for char b + 4 Bytes
for float c ina 32 bit processor)
struct abc
{
int a;
char b;
float c;
}

But in union memory allocated for it is equal to the memory
required by the biggest (in terms of memory it use) union
member.

Example: In a union 'abc' below, memory allocated will be 4
Bytes as float c is the biggest union member here and it
uses 4 Bytes of memory in 32 bit processor.

union abc
{
int a;
char b;
float c;
}

Is This Answer Correct ?    19 Yes 1 No

What is the difference b/w Structure & Union?..

Answer / karthikkumareg

in structure struct key word is used but in union union key
word is used.

Is This Answer Correct ?    6 Yes 9 No

What is the difference b/w Structure & Union?..

Answer / raj kumar

struct can hold multiple data types.
Like u can define a date structure....
but union can multiple data types which includes struct also

union x
{
int x;
struct
{
...
...
}
}

Is This Answer Correct ?    2 Yes 7 No

Post New Answer

More C Interview Questions

When we use void main and int main?

0 Answers  


Where static variables are stored in memory in c?

0 Answers  


Why does the call char scanf work?

0 Answers  


Why is c fast?

0 Answers  


What is the difference between int main and void main?

0 Answers  


what is available in C language but not in C++?

10 Answers   CTS, TCS,


When should a type cast be used?

0 Answers  


Why void is used in c?

0 Answers  


what is the disadvantage of using macros?

1 Answers   Wipro,


2. Counting in Lojban, an artificial language developed over the last fourty years, is easier than in most languages The numbers from zero to nine are: 0 no 1 pa 2 re 3 ci 4 vo 5 mk 6 xa 7 ze 8 bi 9 so Larger numbers are created by gluing the digit togather. For Examle 123 is pareci Write a program that reads in a lojban string(representing a no less than or equal to 1,000,000) and output it in numbers.

3 Answers   Nagarro,


write a program of palindrome(madam=madam) using pointer?

5 Answers   L&T,


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

0 Answers  


Categories