Converting parameters in an array

Joined
Apr 1, 2009
Messages
1
Reaction score
0
Hi everyone,

I just joined here and had a question regarding a problem I'm working on.

I want to display the following information:

cin.getline(isbn, MAX_ISBN);
cout << "\nTitle:";
cin.getline(bookTitle, MAX_TITLE);
cout << "\nAuthor:";
cin.getline(author, MAX_AUTHOR);
cout << "\nPublisher:";
cin.getline(publisher, MAX_PUBLISHER);
cout << "\nDate Added:";
cin.getline(dateAdded, MAX_DATE);
cout << "\nQuantity-On-Hand:";
cin.getline(qtyOnHand, MAX_ROW);
cout << "\nWholesale Cost:";
cin.getline(wholesale, MAX_ROW);
cout << "\nRetail Price:";
cin.getline(retail, MAX_ROW);

I'm getting this error for each cin.getline:
cannot convert parameter 1 from 'char [20][11]' to 'char *'

I have defined all of the arrays and their sizes in my header:

//Define array sizes
#define MAX_ROW 20
#define MAX_TITLE 51
#define MAX_ISBN 14
#define MAX_AUTHOR 31
#define MAX_PUBLISHER 31
#define MAX_DATE 11

//Define arrays for bookInfo
char bookTitle[MAX_ROW][MAX_TITLE];
char isbn[MAX_ROW][MAX_ISBN];
char author[MAX_ROW][MAX_AUTHOR];
char publisher[MAX_ROW][MAX_PUBLISHER];
char dateAdded[MAX_ROW][MAX_DATE];
int qtyOnHand[MAX_ROW];
double wholesale[MAX_ROW];
double retail[MAX_ROW];

I also have #include "bookInfo.cpp" in my header.

Where is the problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top