Hi,

Environment : VC++,WinNT

I need to write data in a structure to a file.Iam unable to find the exact size of structure. Please see the folowing code,
struct data
{

int age;
char unit;
CString name;

};


Iam using sizeof operator to find the size of the above structure which gives me 12 bytes. But if u look at the structure fields,

size of int =4 bytes

size of char=1 byes

size of CString =4 bytes.

The Actual total size of structure fields is 9 bytes but the size of operator gives me size of struct as 12 bytes.

How to get the actual size of the structure?

Thanx in advance.
NMNB