#define MALLOC(p,s) if(!((p)=malloc(s))){fprintf(stderr,"메모리 충분치않음"); exit(EXIT_FAILURE);}
#define CALLOC(p, n, s)\
if(!((p) = calloc(n, s))) {\
fprintf(stderr, "Insufficient memory");\
exit(EXIT_FAILURE);\
#define MALLOC(p,t,s) if(!((p) = (t*)malloc(s))) { fprintf(stderr, "Insufficient memory"); exit(EXIT_FAILURE); }
MALLOC(pi, int, sizeof(int));
#define CALLOC(p, n, s)\
if(!((p) = calloc(n, s))) {\
fprintf(stderr, "Insufficient memory");\
exit(EXIT_FAILURE);\
#define MALLOC(p,t,s) if(!((p) = (t*)malloc(s))) { fprintf(stderr, "Insufficient memory"); exit(EXIT_FAILURE); }
MALLOC(pi, int, sizeof(int));
'컴퓨터 과학 & 영상처리 관련 > 자료구조 / 알고리즘' 카테고리의 다른 글
Data Structures Using C module 815 - 요약 (2) | 2013.02.04 |
---|---|
발견적 탐색 알고리즘 (heuristic search algorithm) (0) | 2012.10.28 |
map 자료구조 (0) | 2011.12.20 |
중위표기에서 후위표기로의 전환 (0) | 2011.05.29 |