1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>
int main()
{
char ch;
float f;
double d;
char* ptr_ch = &ch;
float* ptr_f = &f;
double* ptr_d = &d;
printf("variable size \t char:%zd float:%zd double:%zd\n", sizeof(ch), sizeof(f), sizeof(d));
printf("ptr size \t\t char:%zd float:%zd double:%zd\n", sizeof(ptr_ch), sizeof(ptr_f), sizeof(ptr_d));
printf("indirected size\t char:%zd float:%zd double:%zd\n", sizeof(&ch), sizeof(&f), sizeof(&d));
printf("type size \t char:%zd float:%zd double:%zd\n", sizeof(char*), sizeof(float*), sizeof(double*));
}
Enter to Rename, Shift+Enter to Preview