how to calculate bytes using C++ code

hi...i would like to know how to write a program to find out how many bytes of memory a struct takes up. i understand how to calculate bytes but do not know how to print out the solution. For eg after declaring a struct data type (call it Customer) that contains these fields:
Name; // max 20 characters
Age; //int
ICNumber; //int
AccountNumber; // 12 characters
so how do u find out how many bytes of memory this struct takes up using c++ code.
That is easy!

cout << sizeof(/*name of struct*/);
thx...
Topic archived. No new replies allowed.