C언어 주석좀 도와주세요 ㅜㅜ
핫다홍
질문 제목 : 주석좀 도와주실분!!아 처음배우는거라 도저희 모르겠내요 ㅜㅜ;;
도와주세용
질문 내용 :
#include stdio.h
#include stdlib.h
void main()
{
struct node{
int data;
struct node *link;
};
typedef struct node linked_node;
linked_node *new_head=null, *temp = null, *head = null;
int num;
new_head = (linked_node *)malloc(sizeof(linked_node));
new_head-data =1;
new_head-link = null;
head = temp = new_head;
num = 2;
while(num = 10)
{
new_head = (linked_node *)malloc(sizeof(linked_node));
if (new_head == null){
printf(memory allocation error);
exit(0);
}
new_head -data = num;
new_head -link = null;
temp -link = new_head;
temp = new_head;
num = num +1;
}
temp = head;
while(temp-link != null)
{
printf(%d - , temp - data);
temp = temp - link;
}
printf(%d \n, temp - data);
}