Which uses less memory?
a)
struct astruct
{
int x;
float y;
int v;
};
b)
union aunion
{
int x;
float v;
};
c)
char array[10];
Answer Posted / jaroosh
And the explanation for the above answer is :
union has the size of the biggest type of its member, so
here its size is 4, while structs size is 4 + 4 + 4 = 16,
and arrays size is 1 * 10 = 10.
| Is This Answer Correct ? | 10 Yes | 0 No |
Post New Answer View All Answers
write a corrected statement so that the instruction will work properly. if (4 < x < 11) y = 2 * x;
What are destructors?
Which bit wise operator is suitable for checking whether a particular bit is on or off?
can any one help to find a specific string between html tags
which is changed to a sting..
weather.html looks (for location) is
What ANSI C++ function clears the screen
a) clrscr()
b) clear()
c) Its not defined by the ANSI C++ standard What is namespace std; and what is consists of? Write about the various sections of the executable image? Why is c++ difficult? Differentiate between the manipulator and setf( ) function? If a header file is included twice by mistake in the program, will it give any error? Is c++ a low level language? Is main a class in c++? What is an orthogonal base class in c++? What is #include c++? How does code-bloating occur in c++?