.
.
.
.
.
.
.
Hi,
I am as they say a beginner
I need to create a pointer to a linked list as a member variable. I have to tried todo this a number of ways but i dont think i understand the terminology.
i have a LinkedList.cpp file and a LinketList.h and and the main program. I'll post the LinkedLIst.h file
#include <cstdlib>
#include <string>
#include<iostream>
#ifndef MARK_FOO
#define MARK_FOO
#include "node.h"
struct node{
std::string data;
node* next;
};
class LinkedList
{
typedef std::string value_type;
typedef size_t size_type;
public:
//constructors
LinkedList();
LinkedList(const LinkedList& obj);
~LinkedList();
//mutating member functions
void Insert_Node_tail( node* tail_ptr, value_type entry);
void list_head_remove(node* head_ptr);
//Extractor fuctions
size_type Node_count(){return many_nodes;}
node* list_search(node* head_ptr, const value_type target);
private:
size_type many_nodes;
node* head_ptr;
node* current;
node* tail_ptr;
//specific Member functions
bool IsList_empty();
// node* LinkedList::LocateNode(size_type Target);
};
#endif
// in my int main() file i have written this to create a pointer to a linked list as a member variable
LinkedList* ptr = NULL;
*ptr = List;
LinkedList& List;
LinkedList List = new LinkedList();
But i think im just lost.
Thanks for any input :)