explain about storage of union elements.
Answer Posted / anandi
Union elements can share the common memory spaces.
For eg.
union stu
{
int rno;
int mark;
float total;
};
In this pg, the compiler allocates 4 bytes to store the
union members. Bcoz, in this pg, the float data type only
requires the large memory size, ie, 4 bytes. And the
remaining members can share this 4 bytes. So if u want to
store rno, it will allocate the first 2 bytes.
And also we can store only one value at a time to the
memory.
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
Write a code on reverse string and its complexity.
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
Differentiate fundamental data types and derived data types in C.
What happens if a header file is included twice?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
Where are some collections of useful code fragments and examples?
Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.
Which is better oop or procedural?
By using C language input a date into it and if it is right?
Write programs for String Reversal & Palindrome check
Why is C language being considered a middle level language?
how should functions be apportioned among source files?
What are the primitive data types in c?
Differentiate between #include<...> and #include '...'
What is a pointer in c plus plus?