What is the main difference between STRUCTURE and UNION?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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.
main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }
9 Answers CSC, GoDB Tech, IBM,
How will u find whether a linked list has a loop or not?
union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
How to count a sum, when the numbers are read from stdin and stored into a structure?
how to swap 3 nos without using temporary variable
Is the following code legal? struct a { int x; struct a b; }
how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns
How to read a directory in a C program?
What is your nationality?
main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }