How can one create a circular linked list?One witch iterator jumps from end to begin automatically .
i.e.
Qt Code:
QLinkedList<QObject> list; QLinkedList<QObject>::iterator indexer; //... list.begin().i->p = list.end().i->n; list.begin().i->p->t = list.end().i->t; list.end().i->n->t = list.begin().i->t; indexer= list.begin(); indexer++;To copy to clipboard, switch view to plain text mode
When indexer reaches list.end I want indexer++ to jump automatically at list.begin.
For some reason program crashes at line 5.
Is there a better solution to this problem?
Bookmarks