오류좀 잡아주세요//9시30분까지 급합니다.
하양이
#include stdio.h
#include malloc.h
#include stdlib.h
#include conio.h
struct linked_list
{
struct data *elament;
struct linked_list *link;
};
struct data
{
char name[30];
char address[50];
char number[30];
}st1[20];
void add_node(struct data *input_data);
void print_linked_list(struct linked_list *now);
void print_reverse_linked_list(struct linked_list *now);
struct linked_list *head;
int main(void)
{
int count=0;
char key;
head = (struct linked_list*)malloc(sizeof(struct linked_list));
head-link=NULL;
do
{
count++;
printf(%2d번 이름입력 ,count);
scanf(%s, &st1[count].name);
printf(%2d번 주소입력 ,count);
scanf(%s, &st1[count].address);
printf(%2d번 전화번호입력 ,count);
scanf(%s, &st1[count].number);
add_node(st1);
printf(%c \n, key);
}while(key!=27);
printf(\n\n);
printf(입력된 순서 : );
print_linked_list(head-link);
printf(\n);
printf(입력의 역순 : );
print_reverse_linked_list(head-link);
printf(\n);
return 0;
}
void add_node(struct data *input_data)
{
struct linked_list *new_node, *last;
last=head;
while(last-link != NULL)
last=last-link;
new_node = (struct linked_list*)malloc(sizeof(struct linked_list));
new_node-elament=data;
new_node-link=last-link;
last-link=new_node;
}
void print_linked_list(struct linked_list *now)
{
while(now!=NULL)
{
printf(%c , now-elament);
now=now-link;
}
printf(\n);
}
void print_reverse_linked_list(struct linked_list *now)
{
if (now-link!=NULL)
{
print_reverse_linked_list(now-link);
printf(%c , now-elament);
}
else
printf(%c , now-elament);
}
이름,주소,전화번호를 입력받고
그걸 역순으로 출력하는건데... 에러가 하나뜹니다..
부탁드려요 9시30분까지요..
번호 | 제 목 | 글쓴이 | 날짜 |
---|---|---|---|
2695766 | 달팽이 배열 어디서 틀렸는지 모르겠습니다ㅠㅠ | 연분홍 | 2025-05-23 |
2695738 | fopen과fclose질문~~ (5) | 희선 | 2025-05-23 |
2695707 | 3의 배수 나타내기. (2) | 수리 | 2025-05-23 |
2695626 | 피보나치수열 과제 때문에 질문 드립니다. (6) | 옆집언니 | 2025-05-22 |
2695595 | 포인트공부중입니다 int형에서 4=1 인가요? (3) | 족장 | 2025-05-22 |
2695567 | 드라이브 고유번호를 가져오는 함수 (2) | 초코맛사탕 | 2025-05-21 |
2695533 | 음수의 산술변환! 질문이요 ㅠㅠ... (4) | 꽃여름 | 2025-05-21 |
2695506 | 구조체 배열 이용 도서목록 출력 프로그램 (1) | 가을귀 | 2025-05-21 |
2695450 | c언어 함수 질문이요.... | 이슬비 | 2025-05-20 |
2695403 | VirtualAlloc함수 및 메모리 질문 | 크리에이터 | 2025-05-20 |
2695355 | c언어 for함수 | 미쿡 | 2025-05-19 |
2695327 | 안녕하세요 제가 이번에 좀 큰 프로그램을.. | 악당 | 2025-05-19 |
2695295 | mutex동기화의 thread기반 채팅 서버소스 질문입니다 | 그루터기 | 2025-05-19 |
2695270 | 질문이요..swap 관한겁니다..ㅠㅠ (3) | 콩알녀 | 2025-05-19 |
2695244 | 노땅초보궁금한게 하나 있는데요..반복문(while문)초보자질문 (6) | 큰꽃늘 | 2025-05-18 |
2695166 | do while 문 어떤것이잘못된건지 모르겠어요 (2) | 아이폰 | 2025-05-18 |
2695122 | 구조체에 대해 물어보고 싶은게 있습니다 ^^^.. (7) | 수련 | 2025-05-17 |
2695091 | txt 파일 입출력 후 2차 배열에 저장하기입니다. (3) | 헛장사 | 2025-05-17 |
2695063 | 수도요금 프로그램좀 짜주세요. | 시내 | 2025-05-17 |
2695033 | 답변좀요ㅠㅠ (1) | 비사벌 | 2025-05-16 |