Can anyone tell me what is wrong with this....I keep getting one error about ..
'initializing' : cannot convert from 'Book ** ' to 'Book *[]'
Any help would be appreciated....
[code]
//class Book
#pragma once
#include "iomanip"
#include <iostream>
#include <string>
#using <mscorlib.dll>
using namespace System;
using namespace std;
class Book
{
private:
int m_Bnumb;
float m_Bprice;
string m_Bauthor;
string m_Bname;
int m_Bquant;
public:
Book(void);
void Dispose();
int main_menu();
void m_update(int, float, string, string, int);
void m_display();
void m_dispord(int);
float m_total();
};
//.cpp
#include "StdAfx.h"
#include "iomanip"
#include "conio.h"
#include "ctype.h"
#include <string>
#include "Book.h"
#include <iostream>
#using <mscorlib.dll>
using namespace System;
using namespace std;
Book::Book(void)
{
m_Bnumb = 0;
m_Bprice = 0;
/* m_Bauthor =;
m_Bname = ;*/
m_Bquant = 0;
}
void Book:ispose()
{
}
void Book::m_update(int Bnumb, float Bprice, string Bauthor, string Bname, int Bquant)
{
m_Bnumb = Bnumb;
m_Bprice = Bprice;
m_Bauthor =Bauthor;
m_Bname = Bname;
m_Bquant = Bquant;
}
void Book::m_display()
{
cout << m_Bnumb << endl;
cout << m_Bprice << endl;
cout << m_Bauthor << endl;
cout << m_Bname << endl;
cout << m_Bquant << endl;
}
void Book::m_dispord(int qty)
{
if ( m_Bquant < qty)
{
m_display();
}
}
float Book::m_total()
{
return m_Bprice * m_Bquant;
}
//program
#include "StdAfx.h"
#include "iomanip"
#include "ctype.h"
#include "conio.h"
#include "Book.h"
#include <iostream>
#include <string>
#using <mscorlib.dll>
using namespace System;
using namespace std;
void inputdata(Book*, int&);
void printall(Book* , int );
void printord(Book* , int );
int main_menu();
int main()
{
cout << setiosflags(ios::fixed)
<< setiosflags(ios::showpoint)
<<setprecision(2);
const MAX = 20;
int ctr = 0;
int menunumb;
(ERROR) Book* MyBook[] = new Book*[MAX];
while (menunumb != 5)
{
menunumb = main_menu();
switch(menunumb)
{
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
default:
{
cout << "Invalid Entry" << endl;
system("pause");
}
}
}
//inputdata(MyBook[], ctr);
//printall(MyBook[], ctr);
//printord(MyBook[], ctr);
return 0;
}
int main_menu()
{
int menunumb;
system("cls");
cout << "Main Menu" << endl; //menu for user to choose an option
cout << endl;
cout << "Select an option..." << endl;
cout << endl;
cout << "1. Enter Information" << endl;
cout << "2. Update Information" << endl;
cout << "3. Display Information" << endl;
cout << "4. Calculate Information" << endl;
cout << "5. Exit" << endl;
cout << endl;
cin >> menunumb;
return menunumb;
}
void inputdata(Book* MyBook[], int& ctr)
{
int Bnumb;
float Bprice;
string Bauthor;
string Bname;
int Bquant;
char contin = 'Y';
while (contin == 'Y' || contin == 'y')
{
cout << "Enter Book Title: " << endl;
cin >> Bname;
cout << "Enter Book Author: " << endl;
cin >> Bauthor;
cout << "Enter Book Number: " << endl;
cin >> Bnumb;
cout << "Enter Book Price: " << endl;
cin >> Bprice;
cout << "Enter Book Quantity: " << endl;
cin >> Bquant;
MyBook[ctr]->m_update(Bnumb, Bprice, Bauthor, Bname, Bquant);
ctr++;
cout << "Again? (Y/N): ";
cin >> contin;
}
return;
}
void printall(Book* MyBook[], int ctr)
{
for( int count = 0; count <= ctr; count++)
{
MyBook[count]->m_display();
}
}
void printord(Book* MyBook[], int ctr)
{
int qty;
cout << "Min order quantity: " << endl;
cin >> qty;
for( int count = 0; count <= ctr; count++)
{