what is the defrenece between structure and union

Answer Posted / kapildalke

Thanks for these answer renuka..............
it means that
struct student
{
int i;
char a,b;
}
it occupy 4 bytes of memory..........
and in case of union
union student
{
int i;
char a,b;
}
it occupies only 2 byte memory.............

Am i write or wrong

Is This Answer Correct ?    21 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a program to concatenation the string using switch case?

1697


What are identifiers in c?

790


What is a stream water?

808


How can you invoke another program from within a C program?

742


how logic is used

1622






What is memory leak in c?

775


What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?

1080


What is %d called in c?

873


Explain 'bit masking'?

765


.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

858


What is const volatile variable in c?

708


In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.

2801


What is null pointer constant?

732


How do you define CONSTANT in C?

788


what is stack , heap ,code segment,and data segment

2356