hobab1987
Member
سلام
مشكل اين برنامه چيه؟ 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);
}