whats the size of class EXP on 32 bit processor?
class EXP
{
char c1;
char c2;
int i1;
int i2;
char *ptr;
static int mem;
};

Answer Posted / shrinidhi

20 bytes.
static is given memory in heap.
for 1st two data members c1 and c2 compiler will take 4
bytes cz of padding.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do inline functions improve performance?

654


How do you differentiate between overloading the prefix and postfix increments?

599


What is lazy initialization in c++?

660


Which is not a valid keyword a) public b) protected c) guarded

749


Comment on assignment operator in c++.

720






Why is c++ a mid-level programming language?

597


What is buffer and example?

531


What is friend class in c++ with example?

512


What is enum class in c++?

715


What is the difference between function overloading and operator overloading?

579


What are the effects after calling the delete this operator ?

565


Who was the creator of c++?

571


How does atoi function work?

631


write a corrected statement so that the instruction will work properly. if (4 < x < 11) y = 2 * x;

1522


What is the difference between c++ and turbo c++?

599