I am trying to create a Linked List to download a txt file and use the linked list to handle the file line by line. When handling the downloaded Linked List operations will be performed on it such as a text editor would. I am encountering some problems however. It seems the "Node(string value)" section of the code has something wrong with it even though the original Node() declaration with no arguments passes. I am unable to figure out quite what it is.
Node.h
class Node
{
public:
Node();
Node(string value);
void setNext(Node *nextNode); // Allows the user to set where the "next" pointer of a node points
friend class LinkedList;
private:
string data; // Data box
Node* next; // Pointer box
};
Node.cpp
# include <string>
# include "Node.h"
using namespace std;
Node::Node()
{
data = "";
next = NULL;
}
Node::Node(string value)
{
data = value;
next = NULL;
}
void Node::setNext(Node *nextNode) // Allows the user to set where the "next" pointer of a node points
{
this->next = nextNode;
}