Memory API1 Memory API란? Memory API란? Memory API란 사용자가 메모리를 관리할 수 있도록 제공하는 System Call이다. 대표적인 Memory API - malloc() : heap 영역에 메모리 공간을 할당한다. - sizeof() : 할당된 메모리 영역의 크기를 가져온다. - free() : malloc을 통해 할당된 메모리 공간을 반환한다. 주의사항 char *src = "hello";// character string char *dst;// unallocated strcpy(dst, src);// Segmentation Fault! 1. 메모리 할당 후 접근한다. int *x = (int*)malloc(sizeof(int));// memory allocate printf("*x = %d\n", *x);.. 2019. 4. 22. 이전 1 다음