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

How we print the table of 3 using for loop in c programing?

7 Answers  


write the function. if all the character in string B appear in string A, return true, otherwise return false.

11 Answers   Google,


abcdedcba abc cba ab ba a a

2 Answers  


main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }

1 Answers  


Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??

0 Answers   Home,






main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }

1 Answers  


#include<stdio.h> void fun(int); int main() { int a; a=3; fun(a); printf("\n"); return 0; } void fun(int i) { if(n>0) { fun(--n); printf("%d",n); fun(--n); } } the answer is 0 1 2 0..someone explain how the code is executed..?

1 Answers   Wipro,


Printf can be implemented by using __________ list.

3 Answers  


main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }

1 Answers  


void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }

1 Answers  


#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); }

1 Answers  


#include<stdio.h> int main() { int x=2,y; y=++x*x++*++x; printf("%d",y); } Output for this program is 64. can you explain how this output is come??

1 Answers  


Categories