Well I dont know where I am going wrong.... I and trying to do this queue with out the STL I am having issues with my enqueue () How do I get the contritor Info into the enqueue.

I am trying to do it as simle as possible and I seem to not be able to get around this one thing. Any help would be nice .

Recommended Answers

All 10 Replies

Member Avatar

If you want to enqueue Contributors, why do you use an int array? And why the () in the parameter of enqueue()? Do you want to enqueue Contributor objects or pointers to Contributor objects?

Member Avatar

And a style hint:

if (Index == size){return true;}
		else{return false;}

is the same as

return Index == size;

How would you do either or both (enqueue contributor objects or pointers to the contributor objects) I guess would be my question. As a beginner as well, I'm not sure how you would pass either into the function.

I copied the code and started changing how it's done and no matter how I do it, I get errors. Some that say not an overloaded function, some that say cannot convert from int, and some that say something about referencing a non constant object

I would also ask (dunno if Phil wants to know this also) how would this be implemented in main?

Also, how do you declare the array if you want it to be an array of Contributors?

wellI rewrote the MyQueue.h and cpp but I cant get it to work.
1. myQueue &operator = (myQueue & RHS);
2 . I dont know if my enqueue() is correct.

gerry .. if you found a way .. let me know

Phil, I'll have another look in the AM, I got on kinda late

I was still working on your last version, and I might have a clue now...lol.

Are we missing a "const" before the myQueue within the parentheses?

Also, do we need to pass all that info individually in the enqueue function? I don't think so. We should be able to pass it just like we did with the linked list, by using (Contributor In) or something like that.

got the overloaded = function fixed, but still not sure how to pass the contributor object into the enqueue function

Member Avatar
bool enqueue(Contributor const & contributor);


bool enqueue(Contributor const * contributor);

or something like that. I don't know, if you want to pass contributor by refenrence o by pointer.


I have your queue stuff all figured out except for one thing, and I'll post that as a separate question.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.