Hi, I am getting an error with this code. 'Incompatible types in assignment of char to char[13]' I can't figure out how to initialize these arrays and make this work. Basically, the program takes ISBN codes (4 groups of integers and makes one string with '-' in them between each group of numbers) and verifies that they are correct. The program uses a class ISBN and a main function that loads the actual ISBN codes and tries to use the class ISBN to test them. Here is what I have.
class ISBN {
private:
char group[6];
char publisher[8];
char book[8];
char check;
char isbn[13];
char compute_check();
public:
ISBN();
ISBN(char newisbn[]);
ISBN(char group[ ], char publisher[ ], char book[ ], char check);
bool valid();
char *getpublisher();
void print(ostream &o);
};
ISBN::ISBN(char newisbn[]) : isbn(newisbn) {}
The program loads these ISBN numbers and then prints and tests them using the class ISBN in the following way...
strcpy(isbns[index++], "1-57676-074-X");
ISBN isbn(isbns[i]);
isbn.print(cout);
if (isbn.valid())
I'm having trouble converting the ISBN codes into the ISBN class so that they can be operated on by each of these functions. Any help much appreciated! Thanks!