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??