C++
Need help implementing a copy function that does thefollowing:
Add a copy member function to the List class. This function willhave the prototype: void copy(Array&). It will traverse thelinked list and add every Book pointer that is currently in thelist to the parameter array. Note that this will be a shallow copy.We are not creating new books! We are simply copying all thepointers from one container (the list) into another (thearray).
#ifndef LIST_H_
#define LIST_H_
#include “Book.h”
class Node {
public:
Node *next;
Node *prev;
Book *book;
};
class List {
private:
Node *head;
public:
List();
virtual ~List();
void add(Book *);
void format(string& out);
void print();
//copy member function
void copy(Array&);
};
#endif /* LIST_H_ */
Array header file
#ifndef ARRAY_H
#define ARRAY_H
#include “Book.h”
using namespace std;
#define
PayPal Gateway not configured
PayPal Gateway not configured