Say we have a class defined as,

class c
{
char c1;
char c2;
int i1;
int i2;
char *ptr;
static int mem;
};

What is the size of the class c on a 32 bit processor? Here is what I think.

char c1: 1 byte
char c2: 1 byte
int i1: 4 bytes
int i2: 4 bytes
char* ptr: 4 bytes
static int mem: 4 bytes

Totally, 18 bytes. Am I right? Thanks for your inputs.