which one is better structure or union?(other than the
space occupied )
Answer Posted / shrikant auti
strucure is always better than union.
there are to reasons
1.
union occupies incorrect memory.
e.g.
if the lower memory space data is preceeded by higher one.
Then memory should be alloted is addition of these two, but
the memory will be alloted will be any one out of higher
and lower there is no way to assure what memory would be
occupied.
2.
the data given in union is not necessarily be(maybe/may not
be) extreacted properly.
but in structure correct amount of memory space will be
occupied and extracting element is easy.
| Is This Answer Correct ? | 13 Yes | 2 No |
Post New Answer View All Answers
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....
What is the main difference between calloc () and malloc ()?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.
Can you please compare array with pointer?
Explain zero based addressing.
Is there a way to switch on strings?
a program that can input number of records and can view it again the record
What is 02d in c?
Why double pointer is used in c?
Explain the use of keyword 'register' with respect to variables.
What is the purpose of 'register' keyword in c language?
What are disadvantages of C language.
write a program to display all prime numbers
Explain what are the advantages and disadvantages of a heap?