Linpei's Blog
Saturday, 1 December 2012
Week 9_int& operator[](unsigned int index)
int& Queue::operator[] (unsigned int index){
unsigned int size = this->size();
Node* idx = _head;
for(int i=0; i<int(index%size); i++){
idx = idx->_next;
}
return idx->_data;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment