What language are you after?
Can you share some code?
In C (C++) you can use the built-in sizeof operator to find out the size taken in memory for any variables.