Page 1 of 1

C++ , FIFO

PostPosted: Tue Jul 26, 11 3:58 pm
by ynnaD
Anyone here who is in the know about C++? Need some help here.

I've made a program that has 3 linked lists operating as stacks, but i was wondering how to go about changing them to FIFO (First In, First Out) instead, if you havn't a clue what i'm talking about just say! If anyone knows how i could do this, lemme know and ill show you the code i've made.

Ta!

PostPosted: Fri Jul 29, 11 9:23 am
by ~ô¿ô~Nobody~
If you're using the linked lists from the standard template library, there exist push and pop functions for the begin and the end of the list.
..something like push_front, push_back, pop_front, pop_back.

If you are accessing that lists over multiple threads, the list access operations should be synchronized or the program might crash randomly.