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 |
How we print the table of 3 using for loop in c programing?
write the function. if all the character in string B appear in string A, return true, otherwise return false.
abcdedcba abc cba ab ba a a
main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }
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 ??
main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }
#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..?
Printf can be implemented by using __________ list.
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); }
void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }
#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); }
#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??