What is the main difference between STRUCTURE and UNION?

Answers were Sorted based on User's Feedback



What is the main difference between STRUCTURE and UNION?..

Answer / shilpa

in union the size allocated is the size of the highest
member whereas in structure the size allocated is the sum of
the size of all its declerations. 

Is This Answer Correct ?    1 Yes 0 No

What is the main difference between STRUCTURE and UNION?..

Answer / rakesh kumar

Hi frnds...
structure and union made for different purpose....
There are no comprision between them....
frnds how can campare a car and a coconut tree....

Is This Answer Correct ?    4 Yes 15 No

What is the main difference between STRUCTURE and UNION?..

Answer / anurag

At the one time only one data member can be access...or can
be used.

Is This Answer Correct ?    78 Yes 101 No

Post New Answer

More C Code Interview Questions

main() { static int a[3][3]={1,2,3,4,5,6,7,8,9}; int i,j; static *p[]={a,a+1,a+2}; for(i=0;i<3;i++) { for(j=0;j<3;j++) printf("%d\t%d\t%d\t%d\n",*(*(p+i)+j), *(*(j+p)+i),*(*(i+p)+j),*(*(p+j)+i)); } }

1 Answers  


enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }

2 Answers  


Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.

2 Answers   Wipro,


Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like.

21 Answers   ABC, eBay, Goldman Sachs, Google, HUP, Microsoft, TATA,


program to find the roots of a quadratic equation

14 Answers   College School Exams Tests, Engineering, HP, IIIT, Infosys, Rajiv Gandhi University of Knowledge Technologies RGUKT, SSC,






#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }

1 Answers  


find A^B using Recursive function

2 Answers  


plz send me all data structure related programs

2 Answers  


write a program to Insert in a sorted list

4 Answers   Microsoft,


¦void main() ¦{ ¦int i=10,j; ¦ j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-30 but in same question if we write as- ¦void main() ¦{ ¦int i=10; ¦ int j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-33 why output is changed from 30 to 33. Can any body answer...

3 Answers  


#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

1 Answers  


main() { char c; int i = 456; clrscr(); c = i; printf("%d", c); } a. 456 b. -456 c. random number d. none of the above

3 Answers   BrickRed, HCL,


Categories