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 / gourav bhatt

Mr Ranjeet u r wron vecause ib ur case too the answer will
be "b" .thats gud that u find misktake in jaroosh example but
the anser is b coz the union has size 4 .

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is dev c++ used for?

613


what are Access specifiers in C++ class? What are the types?

638


Write a single instruction that will store an EVEN random integer between 54 and 212 inclusive in the variable myran. (NOTE only generate EVEN random numbers)

1498


What is difference between rand () and srand ()?

600


What is virtual destructor ans explain its use?

612






Write about the stack unwinding?

637


How is modularity introduced in C++?

774


What are pointer-to-members in C++? Give their syntax.

624


What are 2 ways of exporting a function from a dll?

626


How are virtual functions implemented in c++?

612


Why do we use setw in c++?

660


What is doubly linked list in c++?

643


What does it mean to declare a destructor as static?

630


What is command line arguments in C++? What are its uses? Where we have to use this?

586


What are pointer-to-members? Explain.

640