Course Solutions Uncategorized (Solved) : C Need Help Implementing Copy Function Following Add Copy Member Function List Class Funct Q33248649 . . . .

(Solved) : C Need Help Implementing Copy Function Following Add Copy Member Function List Class Funct Q33248649 . . . .

 

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

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post