C언어 썸네일형 리스트형 더블포인터 이해한 부분이라고 생각했는데 이번 프로젝트때 이것때매 조금 꼬임..;;; 잘 안써먹던 놈이라 어찌써먹을찌 바로 생각이 안나니 일단 저장. 더블포인터 사용전 #include void swap(int *p1, int *p2); int main(void) { int a = 10, b = 20; int *pa, *pb; pa = &a; pb = &b; printf("pa : %d\n",*pa); printf("pb : %d\n",*pb); swap(pa,pb); printf("pa : %d\n",*pa); printf("pb : %d\n",*pb); return 0; } void swap(int *p1, int *p2) { int *temp; temp = p1; p1 = p2; p2 = temp; } 주소를 전.. 더보기 binary tree 1. binary_tree.h #include #include typedef struct node{ int id; node *left; node *right; }ND; extern ND *root; int new_Node(int ); ND *insert_Node(ND *); void delete_Node(ND *); 2.binary_tree.c #include "binary_tree.h" void delete_Node(ND *p){ if(p->left != NULL) delete_Node(p->left); if(p->left != NULL) delete_Node(p->right); printf("%d\n",p->id); free(p); } ND* insert_Node(ND *p,ND *new_node){.. 더보기 이전 1 다음