Question
please help me. i dont know why my source code is error #include #include using namespace std; class books { public: char publisher; char author;
please help me. i dont know why my source code is error
#include
using namespace std; class books
{ public: char publisher; char author; char bookname; float bookprice; int copies; books(){ char *bookname=new char; char *author=new char; char *publisher=new char; int copies=0; float bookprice=0.0; } void accept(); void display(); };
void books::accept() { cout<<"BOOK TITLE : "; cin>>bookname; cout<<"AUTHOR : "; cin>>author; cout<<"PUBLISHER OF BOOK : "; cin>>publisher; cout<<"NUMBER OF COPIES AVAILABLE : "; cin>>copies; cout<<"PRICE : "; cin>>bookprice; }
void books::display(){ cout<<"/n"< int main(){ books b; char nmbook,auth; int i,count=0,choice,ch,cpy,flag=0; float total; cout<<"============================================================="< } } if (flag==0) { cout<<" \t\t Entered number of copies are not available to us"; } break; case 4:return 1; break; } } while (ch!=4); return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started