what is the difference between structure and union?
Answers were Sorted based on User's Feedback
Answer / karthikeyan
union is unified memory where structure is non unified memory.
all members of structure occupy consecutive chunks of
memory.but union members will share the most highest memory
of the union member.i.e data type.
we can access all the members of structure at a time.
but in union we can access a single union member at a time.
regards,
karthikeyan,
TRIOZTECH
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / dasari chaithanya
The difference between structure and union is ,structure
will occupie total number of bytes or memory sometimes
waste memory,but union is which is the higest memory than
the data will store the memory location.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / sevak.yatrik777
While structure enables us treat a number of different
variables stored at different in memory , a union enables us
to treat the same space in memory as a number of different
variables. That is a Union offers a way for a section of
memory to be treated as a variable of one type on one
occasion and as a different variable of a different type on
another occasion.
| Is This Answer Correct ? | 0 Yes | 0 No |
write a C code To reverse a linked list
How to find the usage of memory in a c program
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
How can I convert a number to a string?
what is self refrential structure
Differentiate between functions getch() and getche().
What is the use of function overloading in C?
#include<stdio.h> #include<conio.h> void main() { int m=0111,n=20; printf("%d%d\n",m,n); getch(); }
hi, which software companys will take,if d candidate's % is jst 55%?
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
int main(){ float f=8.0; if(f==8.0) printf("good"); else printf("bad"); } what is the answere and explain it?
What is the explanation for cyclic nature of data types in c?