a call is made
Expand|Select|Wrap|Line Numbers
- myQueue.addItem("green");
Expand|Select|Wrap|Line Numbers
- QueueItem *pQI = new QueueItem(pData, ++mNodeCounter);
Expand|Select|Wrap|Line Numbers
- class QueueItem {
- public:
- QueueItem(char *pData, int id){mNodeID = id;
- mpNext = 0;};
- void setNext(QueueItem *pItem);
- QueueItem getNext(){return *mpNext;};
- void printData(){ cout << mData << endl;};
- private:
- char mData[30];
- int mNodeID;
- QueueItem * mpNext;
- };
I tried doing mData = &pData, but that wasn't the right way. So out of guessing I tried mData = pData, and mData = *pData none of which worked.
Pointers are still my weakest area in c++. And I've never had the text initiated in the function like this before. I think this is all the code that is needed to show what I'm trying to accomplish but if more of it is needed let me know. Thanks for any help.