Hi I'm newbie on the linked list concept and I'm trying to write a program that can basically allow a user to store information into a linked list with the basic functions: append, delete, display, etc.
My header file:
Code:
//Specification file for the ScheduleList class
#ifndef SCHEDULELIST_H
#define SCHEDULELIST_H
#include <iostream>
class ScheduleList
{
private:
struct ListNode
{
int number;
ListNode *next;
};
ListNode *head;
public:
ScheduleList()
{ head = NULL;}
~ScheduleList();
void appendNode(int);
//void deleteNode();
// void displayList();
};
#endif
The Cpp file for it:
Code:
//Implementation file for the ScheduleList class
#include "ScheduleList.h"
#include <iostream>
using namespace std;
void ScheduleList::appendNode(int num)
{
ListNode *newNode, *nodeptr;
newNode = new ListNode;
newNode->number = num;
newNode->next=NULL;
if(!head)
head = newNode;
else
{
nodeptr = head;
while(nodeptr->next)
nodeptr=nodeptr->next;
nodeptr->next = newNode;
}
}
and my Main cpp file:
Anyways, it's not much so far but that's because I'm trying to do little by little so that I can be sure that it is working.
Whenever I try and compile, it keeps giving me these same 3 error messages:
Code:
main.obj : error LNK2001: unresolved external symbol "public: __thiscall ScheduleList::~ScheduleList(void)" (??1ScheduleList@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall ScheduleList::appendNode(int)" (?appendNode@ScheduleList@@QAEXH@Z)
Debug/main.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
I have read through many forums, but I am still clueless as to what exactly the problem is.
Any help is greatly appreciated. Thanks.