#include <stdio.h>
#include <stdlib.h>
struct node
{
int data;
struct node *next;
};
typedef struct node List;
List* NodeList(int val, List* head)
{
List *temp = (List*)malloc(sizeof(List));
temp->>
if (head == NULL)
{
temp->next = head;
head = temp;
}
else temp->next = head->next;
return temp;
}
int main(void)
{
List* head;
List* curr;
head = NodeList(3, NULL);
head = NodeList(5, head);
head = NodeList(7, head);
curr = head;
while (curr != NULL)
{
printf("%d ", curr->data);
curr=curr->next;
}
}
제발알려주세요
시러용