:: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Categories >> Software >> Programming Languages >> C


 C interview questions  C Interview Questions (2266)
 C++ interview questions  C++ Interview Questions (1121)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (652)
What is the difference b/w Structure & Union?
 Question Submitted By :: C
I also faced this Question!!     Answer Posted By  
# 1
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

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
Nakul Sharma
# 2
in structure struct key word is used but in union union key
word is used.
Is This Answer Correct ?    6 Yes 9 No
# 3
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;
Is This Answer Correct ?    2 Yes 7 No
Raj Kumar

Other C Interview Questions
  Question Asked @ Answers
give one ip, find out which contry Google 4
how to find sum of digits in C? CTS 21
what is the difference between global variable & static variable declared out side all the function in the file.   2
read a number & print all its devisors using c-program?   3
how to set Nth bit of a variable?   1
In how much time you will write this c program? Prime nos from 1 to 1000 TCS 2
4)What would be the output? main() { int num=425; pf("%d",pf("%d",num)); } a)Comp error b)4425 c)4253 d)3435 e)none   10
what is the output of following question? void main() { int i=0,a[3]; a[i]=i++; printf("%d",a[i] }   3
What is the relation between # and include<stdio.h> HCL 5
WAP &#8211; represent a char in binary format Motorola 4
how to find binary of number?   2
When is an interface "good"?   1
For more C Interview Questions Click Here 

Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
Copyright 2013  All Rights Reserved.   ::