Write a C++ Program for Library database : Linked List with New Operator
//Library Database
#include
#include
#include
#include
class books
{
char **author,**title,**publisher;
int *price;
static int count;
public:
books(void); //constructor
void getdata(void);
void display_stock(void);
void search(void);
};
int books :: count=0;
books :: books(void)
{
author=new char*[15];
title=new char*[15];
publisher=new char*[15];
price=new int[15];
for(int i=0;i<15;i++)>>title[count];
cout<<"Enter Author name:-"; cin>>author[count];
cout<<"Enter Publisher of book:-"; cin>>publisher[count];
cout<<"Enter Price of book:-"; cin>>price[count];
count++;
}
void books :: display_stock(void)
{
clrscr();
cout<<"\n\n\n"; cout<
cout<<"Enter Author of Book:-"; cin>>writer;
for(int i=0;i
switch(choice)
{
case 1 : o1.getdata();
break;
case 2 : o1.display_stock();
break;
case 3 : o1.search();
break;
case 4 : goto out;
default: cout<<"\n\nEnter choice is invalid\nTry again\n";
}
}
out:
}