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

Is it possible to provide special behavior for one instance of a template but not for other instances?

635


When is the copy constructor called?

637


What is a local variable?

582


How do I use arrays in c++?

586


What is setfill c++?

685






Is there any function that can skip certain number of characters present in the input stream?

588


How to declare an array of pointers to integer?

588


Can comments be nested?

632


What is oops in c++?

593


How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?

586


What is searching?

659


Differentiate between the message and method in c++?

612


Is swift better than c++?

542


What are the data types in c++?

523


How java is different from c and c++?

650