Thread: Help with Linked List

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    39

    Help with Linked List

    Just started learning Linked List and I am pretty lost. I have started a class but not sure it it is correct. Just need some feed back on if the class is setup right and any additional things about linked list. Every site I have looked at so far has pretty much did and said the same thing and its not helping any. I understand the concept it is just turning it into code.

    Code:
    #include <iostream>
    #include <string>
    
    using namespace std;
    
    #include "swcString.h" //Custom string class
    
    class objList
    {
    public:
    	objList();
    	~objList();
    	
    	objList operator+(objList);
    
    private:
    	swcString objName;
    	swcString objMaterial;
    	int objWeight;
    	int objMass;
    };
    
    class objNode
    {
    public:
    	objNode();
    	objNode(objNode &);
    	~objNode();
    	void addNewObj();
    	void delObj();
    	bool emptyObj();
    	void traverseObj();
    	objList * searchObj();
    private:
    	objList object;
    	objNode *start;
    	objNode *next;
    	objNode *previos;
    	objNode *end;
    };
    
    int main (void)
    {
    	return 0;
    }
    also when trying to do
    Code:
    objNode::objNode()
    {
    }
    i get this error:
    Code:
    ompiling...
    main.cpp
    Linking...
    main.obj : error LNK2001: unresolved external symbol "public: __thiscall objList::objList(void)" (??0objList@@QAE@XZ)
    Debug/List.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.
    
    List.exe - 2 error(s), 0 warning(s
    It is not reconizing my constructor in the class for some reason
    Last edited by Bitphire; 03-10-2005 at 07:05 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ Linked list program need help !!!
    By dcoll025 in forum C++ Programming
    Replies: 1
    Last Post: 04-20-2009, 10:03 AM
  2. Following CTools
    By EstateMatt in forum C Programming
    Replies: 5
    Last Post: 06-26-2008, 10:10 AM
  3. Reverse function for linked list
    By Brigs76 in forum C++ Programming
    Replies: 1
    Last Post: 10-25-2006, 10:01 AM
  4. Template Class for Linked List
    By pecymanski in forum C++ Programming
    Replies: 2
    Last Post: 12-04-2001, 09:07 PM
  5. singly linked list
    By clarinetster in forum C Programming
    Replies: 2
    Last Post: 08-26-2001, 10:21 PM