I have writen a program in C++.The program takes a list of books using a constructor.It has a switch statement in the main function in which there are following options:
1] search for a book and purchase it if the book and the required number of copies are available.
2]Change the price of the book.
3]Check the number of successful and unsuccessful transactions.
[Succesful transactions are when the customer buys a book and an unsucessul transaction when either the customer rejects the books or the required number of copies are not available.]
I have a problem in the above program.When I use a new operator to allocate memory for the title,author and the publisher of the book,the program does not work.However when I modify the the same program and use single dimensional array for the title,author and the publisher of the book the program works perfectly
Will you please tell me what is the problem.