[prev] [index] [next]

Exercise: Array Storage

Write a program to determine the storage size of the following:

Types:

char   int   float   double

Variables:

char s[10];  int n;  int a[6];  char *cp;  int *ip;

Also, work out in memory where each variable is located.

Do this for variables declared as local, then as global.