difference between structure and union.
Answer Posted / siva sankari
struct employee
{
int a[20];// for tis size 20 was allocated in memory
char text;// for tis only 1byte of memory space is allocated
}
so totally 21 in size was allocated in memory space
union employee
{
int a[20];// for tis size 20 was allocated in memory
char text;// for tis only 1byte of memory space is allocated
}
but in union it takes only the maximum memory space so for each 20space totally 40 size was allocated in memory space
| Is This Answer Correct ? | 7 Yes | 12 No |
Post New Answer View All Answers
what type of questions
What is class and object in oops?
Where You Can Use Interface in your Project
What is destructor oops?
What are the 4 main oop principles?
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
any one please tell me the purpose of operator overloading
What is this pointer in oop?
What is methods in oop?
What is encapsulation and abstraction? How are they implemented in C++?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
What is encapsulation in oops?
write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.
What is a null tree?
What is abstraction in oop?