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 to swap 3 nos without using temporary variable
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }
main() { int i=5,j=6,z; printf("%d",i+++j); }
main( ) { static int a[ ] = {0,1,2,3,4}; int *p[ ] = {a,a+1,a+2,a+3,a+4}; int **ptr = p; ptr++; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); *ptr++; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); *++ptr; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); ++*ptr; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); }
What is the problem with the following code segment? while ((fgets(receiving array,50,file_ptr)) != EOF) ;
Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }
How we will connect multiple client ? (without using fork,thread)
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); }
Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines
char inputString[100] = {0}; To get string input from the keyboard which one of the following is better? 1) gets(inputString) 2) fgets(inputString, sizeof(inputString), fp)
main() { char *p; int *q; long *r; p=q=r=0; p++; q++; r++; printf("%p...%p...%p",p,q,r); }
How do you create a really large matrix (i.e. 3500x3500) in C without having the program crash? I can only reach up to 2500. It must have something to do with lack of memory. Please help!