Question: hello ive done this source code. but, the input that i can insert is just for 1 words. for an example the book title is
hello ive done this source code. but, the input that i can insert is just for 1 words. for an example the book title is 'the meg' but i just can put 'the' only and not in the full sentences. also same with the publisher and author name. should i do. please help me :'(
#include
using namespace std; class books
{ public: char *publisher; char *author; char *bookname; float bookprice; int copies; books(){ bookname=new char[50]; author=new char[50]; publisher=new char[50]; copies=0; 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<<" "< int main(){ books b[100]; char *nmbook,*auth; nmbook = new char[50]; auth = new char[50]; int i,count=0,choice,ch,cpy,flag=0; float total; cout<<"============================================================="<
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
