| | |
cirular arrys queue has me running in circles
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2008
Posts: 20
Reputation:
Solved Threads: 0
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 .
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 .
•
•
Join Date: Dec 2007
Posts: 360
Reputation:
Solved Threads: 69
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?
If you are forced to reinvent the wheel at least try to invent a better one!
Please use code tags - Please mark solved threads as solved
Please use code tags - Please mark solved threads as solved
•
•
Join Date: Dec 2007
Posts: 360
Reputation:
Solved Threads: 69
And a style hint:
is the same as
C++ Syntax (Toggle Plain Text)
if (Index == size){return true;} else{return false;}
is the same as
C++ Syntax (Toggle Plain Text)
return Index == size;
If you are forced to reinvent the wheel at least try to invent a better one!
Please use code tags - Please mark solved threads as solved
Please use code tags - Please mark solved threads as solved
•
•
Join Date: Dec 2007
Posts: 226
Reputation:
Solved Threads: 1
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?
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?
•
•
Join Date: Dec 2007
Posts: 360
Reputation:
Solved Threads: 69
C++ Syntax (Toggle Plain Text)
bool enqueue(Contributor const & contributor);
or
C++ Syntax (Toggle Plain Text)
bool enqueue(Contributor const * contributor);
or something like that. I don't know, if you want to pass contributor by refenrence o by pointer.
If you are forced to reinvent the wheel at least try to invent a better one!
Please use code tags - Please mark solved threads as solved
Please use code tags - Please mark solved threads as solved
![]() |
Other Threads in the C++ Forum
- Previous Thread: Linked List Delete
- Next Thread: Having problem in writting simulation on Random Early Detection (RED) using C++
| Thread Tools | Search this Thread |
api array arrays based binary c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game generator givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets





