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

How old is c programming language?

589


Can you write a programmer for FACTORIAL using recursion?

618


Is int a keyword in c?

561


One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.

2162


What is masking?

644






What does the error 'Null Pointer Assignment' mean and what causes this error?

749


write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list

2242


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

574


What are 'near' and 'far' pointers?

628


How can you find out how much memory is available?

620


When should we use pointers in a c program?

640


can anyone suggest some site name..where i can get some good data structure puzzles???

1649


What are the types of type specifiers?

627


How many levels of indirection in pointers can you have in a single declaration?

601


Why we use break in c?

556