Here's my problem. I've been trying to run this porgram forever and I CANT get this one error to fix!!!! What's wrong? (Sorry, its very long and ineffecient... work with me)
Code:
#include <iostream.h>
#include <iomanip.h>
#include <string.h>
#include "CASHIER.H"
#include "INVMENU.H"
#include "BOOKINFO.H"
void cashier(void)
{
extern int arraySize;
extern char bookTitle[]; //these were originally in mainmenu.cpp, but had
extern char isbn[]; //to move them here so that bookTitle could be found.
extern char author[];
extern char publisher[];
extern char dateAdded[];
extern int qtyOnHand[];
extern float wholesale[];
extern float retail[];
char date[10], another, additional;
int books;
int quantity[50];
//char isbn2[50];
char title[50][50];
float price[50];
float subtotal = 0, sub[50];
float total = 0;
float tax = 0;
const double TAX = .06;
do
{
cout << "How many different books are being purchased? ";
cin >>books;
cout << "Please enter the date in MM/DD/YY format --> ";
cin >> date;
for (int count = 0; count < books; count++)
{
cout << "\nPlease enter the quantity of books being purchased --> ";
cin >> quantity[count];
cout << "\nPlease enter the ISBN number of the book being purchased --> ";
cin >> isbn[count];
cout << endl << endl;
for (int counter = 0; counter < 50; counter++)
{
if (isbn[counter] == isbn[count])
{
cout << endl << endl;
cout << bookInfo(isbn[count], bookTitle[count], author[count], publisher[count], dateAdded[count], qtyOnHand[count], wholesale[count], retail[count]);
cout << endl << endl;
break;
}
}
cin.ignore(); //because the getline function will accept the null terminator at the end of the previous cin if this is not place before it.
cout << "\nPlease enter the title of the book --> ";
cin.getline(title[count],50);
cout << "\nPlease enter the price of the book --> ";
cin >> price[count];
sub[count] = price[count] * quantity[count];
subtotal += sub[count];
tax += subtotal * TAX;
total += subtotal + tax;
}
cout << "\n\n\n\n\n\nSerendipity Booksellers\n\n";
cout << "Date: "<< date << "\n\n";
cout << "Qty ISBN Title Price Total\n";
cout << "----------------------------------------------------------------------------\n\n\n";
for(count = 0; count < books; count++)
{
cout.precision(2);
cout.width(6); //the width function sets the amount of space for the upcoming set of characters or numbers.
cout.setf(ios::fixed|ios::showpoint|ios::left); //sets fixed point notation, shows decimal points and left justifies everything.
cout << quantity[count] << " ";
cout.width(10);
cout << isbn[count] << " ";
cout.width(36);
cout << title[count] << " " ;
cout.width(10);
cout << price[count]<< " ";
cout.width(15);
cout << sub[count];
cout << endl;
}
cout << "\n\n\n\n Subtotal "<< subtotal << "\n";
cout << " Tax "<< tax << "\n";
cout << " Total " << total << "\n\n\n\n";
cout << "Would you like to process another transaction? (Y/N) ";
cin >> another;
}
while (another == 'y' || another =='Y'); //as long as the user enters y or Y, the program will contiue allowing for more transactions.
cout << "Thank you for shopping at Serendipity!\n\n\n\n";
}
Here's my error:
error C2664: 'bookInfo' : cannot convert parameter 1 from 'char' to 'char []'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
And it happens here:
Code:
if (isbn[counter] == isbn[count])
{
cout << endl << endl;
******RIGHT HERE --> cout << bookInfo(isbn[count], bookTitle[count], author[count], publisher[count], dateAdded[count], qtyOnHand[count], wholesale[count], retail[count]);
cout << endl << endl;
break;
}