c언어로 만든 자기참조 구조체 및 메모리 포인터 (링크드 리스트) 프로그램
본 자료는 미리보기를 지원하지 않습니다.
닫기
  • 1
  • 2
해당 자료는 0페이지 까지만 미리보기를 제공합니다.
0페이지 이후부터 다운로드 후 확인할 수 있습니다.

본문내용

#include
#include
struct selfref
{
int n;
struct selfref *next;
};
typedef struct selfref list;
int main(void)
{
list *first = NULL, *second = NULL, *third = NULL, *middle = NULL;
first = (list *) malloc(sizeof(list));
first->n = 100;
second = (list *) malloc(sizeof(list));
second->n = 200;
third = (list *) malloc(sizeof(list));
third->n = 300;
middle = (list *) malloc(sizeof(list));
middle->n = 150;
/*
first->next = second;
second->next = third;
third->next = NULL;
middle->next = second;
first->next = middle;
middle->next = third;
*/
first->next = second;
second->next = third;
third->next = NULL;
middle->next = second;
first->next = middle;
printf("첫번째 구조체 >> \n");
printf("\t 자료 값(first->n) = %d", first->n);
printf("\t 자료의 주소값(first) = %#X \n\n", first);
  • 가격1,000
  • 페이지수2페이지
  • 등록일2007.10.31
  • 저작시기2007.10
  • 파일형식기타(cpp)
  • 자료번호#434470
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니