도서관리 수정함수를 만들려하는데요....ㅠㅠ
이송이
도서관리프로그램 수정함수를 만들고 잇는데요...이상하게 book[top].name=ch;
이부분에서 계속 에러가 나네요 ㅠㅠㅠㅠㅠ
최대한 짜본건데 더이상 진보가 없네요....질문 내용 : void re(void)
{
file* file =fopen(libray.txt, at);
char name[20];
char ch[20];
printf(수정하실 책의 이름을 입력하시오: );
scanf(%s,&name);
for(top=0;top200;top++)
{
fscanf(file, %s\n,book[top].name);
fscanf(file, %s\n,book[top].writer);
fscanf(file, %d\n,&book[top].year);
fscanf(file, %s\n,book[top].company);
if(!*book[top].name) break;
}
for(top=0; top200; top++)
{if(strcmp(book[top].name,name)==0)
{
printf(도서명:%s\n, book[top].name);
printf(저자:%s\n, book[top].writer);
printf(출판년도:%d\n, book[top].year);
printf(출판사:%s\n, book[top].company);
printf(무엇을 수정 하시겠습니까:);
printf(1.도서명 \n);
scanf(%s,&ch);
book[top].name=ch;fprintf(file,%d\n,book[top].name);}
}
fclose(file);
}
-
지니
book에 대한 정보가 필요할 듯 보이네요. 쟤들 선언을 어떻게 해줬는지...
-
단화한
휴.. 제 실력으로는..