Thanks for all the replies. Sorry its been so long since I posted. Things came up but i'm back. Had class tonight and got this error and even the teacher wasn't to sure on why. So I am hoping you guys can help. Thanks.
Error:
Code:
--------------------Configuration: LinkedList - Win32 Debug--------------------
Compiling...
objList.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\LinkedList\objList.cpp(55) : error C2440: '=' : cannot convert from 'class objList::objNode *' to 'class objNode *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
LinkedList.exe - 1 error(s), 0 warning(s)
Here is my code that I have:
Code:
#include <iostream>
using namespace std;
#include "swcString.h"
class objNode;
class objList;
class objList
{
public:
objList();
void addObj(swcString nameOfObj, swcString materialOfObj, int weightOfObj, int massOfObj);
private:
objList::objNode *start;
objNode *end;
class objNode
{
public:
swcString objName;
swcString objMaterial;
int objWeight;
int objMass;
objNode *next;
objNode *previous;
};
objNode myNode;
};
int main(void)
{
cout << "Hello World!" << endl;
return 0;
}
objList::objList()
:start(NULL), end(NULL)
{
}
void objList::addObj(swcString nameOfObj, swcString materialOfObj, int weightOfObj, int massOfObj)
{
objNode *newNode = new objList::objNode;
newNode->objName = nameOfObj;
newNode->objMaterial = materialOfObj;
newNode->objWeight = weightOfObj;
newNode->objMass = massOfObj;
newNode->next = NULL;
start = newNode;
}