SOLVED.

SOLVED.
Last edited on
Book booklist[] = new booklist[3];//wrong!
You are not allocating 3 booklists, you are allocating 3 books:
Book booklist[] = new Book[3];//right!
Your prototype is wrong too.
void Initalize(struct Book *[], int size);//wrong!
What is the name of the first argument???
void Initalize(struct Book (*booklist)[], int size);//right!
note that int *x[]; is an array of pointers, whereas int (*x)[]; is a pointer to an array.
Last edited on
SOLVED.
Last edited on
Right. You can't assign to it. It must be:
Book booklist [3];
The skips the allocation step.
you don't need to delete it, either.
SOLVED.
Last edited on
the problem is here:
1
2
string title[LENGTH]; //wrong
string author[LENGTH]; //wrong 

strings don't require the length. they change size automatically.
1
2
string title;
string author;
Topic archived. No new replies allowed.