سلام اساتید و بزرگان
این برنامه ای که نوشتم 2 تا ارور میده لطفا راهنماییم کنید!
این برنامه ای که نوشتم 2 تا ارور میده لطفا راهنماییم کنید!
#include <stdio.h>
#include <conio.h>
#include <process.h>
struct bookinfo{
addnew();
private:
char title[20];
char author[15];
char publisher[15];
char stead[50];
int history;
int version_num;
};
int menu();
void addnew();
void quit();
//************************************************** ****************************
//Main Part Of The Program
//************************************************** ****************************
int main()
{ bookinfo inf;
int choise;
char wrd;
for( ; ; )
{
clrscr();
choise=menu();
switch(choise)
{
case 1: //Entering new bookinf
clrscr();
inf.addnew();
break;
case 2: //searching a word
printf("Enter a word to search:"
;
scanf("%s",&wrd);
break;
case 3: //Reports
case 4: //Exit the program
quit();
break;
default: //Incorrect Value
printf("Enter a valid number between 1_4!"
;
printf("\a"
;
getch();
break;
}
}
}
//***********<<Main menu>>**********
int menu()
{
int p;
gotoxy(35,20);
printf("1)Add record"
;
gotoxy(35,21);
printf("2)Search record"
;
gotoxy(35,22);
printf("3)Reports"
;
gotoxy(35,23);
printf("4)Exit"
;
gotoxy(35,24);
printf("Enter your select(1_4)"
;
scanf("%d",&p);
return p;
}
//*************<<Quit>>*************
void quit()
{
char ans;
gotoxy(28,28);
printf("<<Quit>>"
;
gotoxy(30,30);
printf("Do u wanna to quit(Y/N)?"
;
ans=getch();
if(ans=='y' || ans=='Y'
exit(0);
else
return;
}
//**************<<AddNew Bookinfo>>*************
void bookinfo::addnew()
{
int col=35;
gotoxy(col,20);
printf("Title:"
;
scanf("%s",inf.title);
gotoxy(col,21);
printf("Author:"
;
scanf("%s",inf.author);
gotoxy(col,22);
printf("Publisher"
;
scanf("%s",inf.publisher);
gotoxy(col,23);
printf("Stead"
;
scanf("%s",inf.stead);
gotoxy(col,24);
printf("History"
;
scanf("%d",inf.history);
gotoxy(col,25);
printf("Version_num"
;
scanf("%d",inf.version_num);
}
#include <conio.h>
#include <process.h>
struct bookinfo{
addnew();
private:
char title[20];
char author[15];
char publisher[15];
char stead[50];
int history;
int version_num;
};
int menu();
void addnew();
void quit();
//************************************************** ****************************
//Main Part Of The Program
//************************************************** ****************************
int main()
{ bookinfo inf;
int choise;
char wrd;
for( ; ; )
{
clrscr();
choise=menu();
switch(choise)
{
case 1: //Entering new bookinf
clrscr();
inf.addnew();
break;
case 2: //searching a word
printf("Enter a word to search:"

scanf("%s",&wrd);
break;
case 3: //Reports
case 4: //Exit the program
quit();
break;
default: //Incorrect Value
printf("Enter a valid number between 1_4!"

printf("\a"

getch();
break;
}
}
}
//***********<<Main menu>>**********
int menu()
{
int p;
gotoxy(35,20);
printf("1)Add record"

gotoxy(35,21);
printf("2)Search record"

gotoxy(35,22);
printf("3)Reports"

gotoxy(35,23);
printf("4)Exit"

gotoxy(35,24);
printf("Enter your select(1_4)"

scanf("%d",&p);
return p;
}
//*************<<Quit>>*************
void quit()
{
char ans;
gotoxy(28,28);
printf("<<Quit>>"

gotoxy(30,30);
printf("Do u wanna to quit(Y/N)?"

ans=getch();
if(ans=='y' || ans=='Y'

exit(0);
else
return;
}
//**************<<AddNew Bookinfo>>*************
void bookinfo::addnew()
{
int col=35;
gotoxy(col,20);
printf("Title:"

scanf("%s",inf.title);
gotoxy(col,21);
printf("Author:"

scanf("%s",inf.author);
gotoxy(col,22);
printf("Publisher"

scanf("%s",inf.publisher);
gotoxy(col,23);
printf("Stead"

scanf("%s",inf.stead);
gotoxy(col,24);
printf("History"

scanf("%d",inf.history);
gotoxy(col,25);
printf("Version_num"

scanf("%d",inf.version_num);
}
دیدگاه