슬라이드 06

Variables and Memory

Pointers and Memory Allocation

Statically allocated arrays

char buf[512];

sizeof(buf) 는 512를 반환한다.

Dynamically allocated arrays

char *buf = malloc(512*sizeof(char));

sizeof(buf) 는 포인터의 size를 반환한다.

byte size를 구하는 방법은 512 * sizeof(char) 뿐이다.

Data Types and Alignment

x86-64

int 계열: 1, 2, 4, 8

float 계열: 4, 8

pointer : 8

IA-32

슬라이드 08