Thread: need help with FIFO QueueItem member definitions

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    72

    need help with FIFO QueueItem member definitions

    Code:
    //QueueItem.h
    //Declaration of class QueueItem
    
    
    #ifndef QUEUEITEM_H
    #define QUEUEITEM_H
    
    
    
    class QueueItem
    {
    public: 
    	  QueueItem(char *pData, int id);  // constructor
          void setNext(QueueItem *pItem); //set pointer to next Item
          QueueItem* getNext();			//get pointer to next Item
          int getId();					//get Id
          const char* getData();		//get data member
    
    private:
          char mData[30];  // or, use a char* if you want to dynamically alloc memory 
          int mNodeID;
          QueueItem * mpNext;			// pointer to another object of same type
    };//end class QueueItem
    
    #endif
    
    //member function definitions for class QueueItem
    
    #include  <iostream> // allows program to output data
    using namespace std;
    
    #include  <string> 
    
    #include "QueueItem.h" // include definition of class QueueItem from QueueItem.h
    
    QueueItem::QueueItem(char *pData, int id)
    {
    	id = mNodeID;
    	pData = mData;
    }
    void QueueItem::setNext(QueueItem *pItem)
    {
     if ( pItem->mpNext != 0 )
    	 pItem->mpNext
    }
    
    getNext();
    {
    	return mpNext;
    }
    int QueueItem::getId();
    {
    	return mNodeID;
    }
    
    const char* QueueItem::getData()
    {
    	return mData;
    }

    I can't seem to come with member definitions for class QueueItem, can somebody tell me what i'm doing wrong??
    Last edited by jackfraust; 02-21-2009 at 06:55 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Help with FIFO QUEUE
    By jackfraust in forum C++ Programming
    Replies: 23
    Last Post: 04-03-2009, 08:17 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  5. Menu Item Caption - /a for right aligned Accelerator?
    By JasonD in forum Windows Programming
    Replies: 6
    Last Post: 06-25-2003, 11:14 AM

Tags for this Thread