[c언어][싱글링크드리스트]


[c언어][싱글링크드리스트]

#include<stdio.h> #include<stdlib.h> #pragma warning(disable:4996) struct stu { int data; struct stu *next; }; void main() { struct stu *head, *cur, *del, *newnode; int num; head = cur = del = newnode = (struct stu*)malloc(sizeof(struct stu)); cur->data = 1; cur->next = NULL; cur ->next = (struct stu*)malloc(sizeof(struct stu)); cur->next->data = 2; cur->next ->next = NULL; cur->next->next = (struct stu*)malloc(sizeof(struct stu)); cur->next->next->data = 3; cur->next->next->next = NULL; while (...



원문링크 : [c언어][싱글링크드리스트]