컴파일 하고 나서 오류창이 생기는데요......
딥체리
#include iostream.h
#include stdio.h
#include stdlib.h
struct book_st{
int a;
int b;
int book_id;
int renter_id;
book_st *next;
book_st *ptr;
};
struct member_st{
int a;
int member_id;
int borrowed_book_id;
member_st *next;
};
struct connect{
connect *A;
connect *B;
};
book_st book[10];
member_st member[10];
book_st *head;
book_st *last;
member_st *forward;
member_st *back;
book_st *location (int y){
book_st *p;
for (p=head-ptr;p!=0;p=p-next){
if (y==p-a)
return p;
}
return 0;
}
member_st *location1(int y){
member_st *p;
for (p=forward-next;p!=0;p=p-next){
if (y==p-a)
return p;
}
return 0;
}
book_st *location2(book_st *y){
book_st *p;
for(p=head-ptr;p!=0;p=p-ptr){
if(y-ptr=p)
return p;
}
return 0;
}
member_st *location3(member_st *y){
member_st *p;
for(p=forward-next;p!=0;p=p-next){
if(y-next=p)
return p;
}
return 0;
}void book_add(){
int x;
cout추가하고자 하는 책을 입력하세요:endl;
cinx;
book_st *p;
p=new book_st;
p-b=x;
last-ptr=p;
p-ptr=0;
last=p;
}
void book_delete(){
int x;
book_st *q;
cout삭제하고자 하는 책을 입력하세요:endl;
cinx;
q=location(x);
if (q==0){
cout리스트에 없습니다.endl;
return;
}
book_st *p;
p=location2(q);
p-next=q-next;
delete q;
}
void book_show(){
book_st *p;
for (p=head-ptr;p!=0;p=p-ptr)
coutp-bendl;
}
void member_add(){
int x;
cout추가하고 하는 사람 번호를 입력하세요:endl;
cinx;
member_st *p;
p=new member_st;
p-a=x;
back-next=p;
p-next=0;
back=p;}
void member_delete(){
int x;
cout삭제하고자 하는 사람 번호를 입력하세요:endl;
cinx;
member_st *q;
q=location1(x);
if (q==0){
cout리스트에 없습니다.endl;
return;
}
member_st *p;
p=location3(q);
p-next=q-next;
delete q;
}
void member_show(){
member_st *p;
for (p=forward-next;p!=0;p=p-next)
coutp-aendl;
}
void book_rent(){
}
void book_return(){
}
void main(){
int i;
int sel,book_id,member_id;
for(;;){
cout book add(1), book del(2), book show(3), member add(4)endl;
cout member del(5), member show(6), rent(7), return(8), quit(9)endl;
cin sel;
if (sel==9) break;
if (sel==1) book_add();
if (sel==2) book_delete();
if (sel==3) book_show();
if (sel==4) member_add();
if (sel==5) member_delete();
if (sel==6) member_show();
if (sel==7) book_rent();
if (sel==8) book_return();
}
}
저기 이게요 자꾸 컴파일 하고나면 오류창이 뜨고 종료 되거든요.
그 이유좀 가르쳐 주세요 ㅜㅜ
-
초롱꽃
ㅋㅋㅋ 컴파일러도 여러가지 있구요. 어떤 컴파일러냐에 따라 warning, error 문이 다릅니다.
상세한 정보가 중요하오니 컴파일러 종류와 어떤 문구가 올라오는지도 적는게 질문을 하시는데 필요하리라 생각되네요 ^^