Changes

Jump to: navigation, search

Queue of Strings - OOP344

281 bytes added, 17:55, 25 November 2010
strque.cpp line 80 _head = _cur; is single = sign
=A Queue of Strings=
Note that this code is neither efficient nor bug free.<br />
Use it just as a base for a double linked list of strings to be optimized later...
==strque.h==
<big><syntaxhighlight lang="cpp">
char* operator[](unsigned int index);
// returns number of nodes
int Size();
// Store the _cur pointer so it can be restored after operation
void StoreCur();
// Restores the _cur pointer back to the last '''SotreCur()''' call.
void RestoreCur();
bool GoHead();
bool GoTail();
int Size();
};
#endif
</syntaxhighlight></big>
 
==strque.cpp==
<big><syntaxhighlight lang="cpp">
_cur = newnode;
_cur->_next->_prev = _cur;
_head == _cur;
}
else{

Navigation menu