Click to See Complete Forum and Search --> : C++ queue


mloone01
June 5th, 2008, 09:33 AM
Hi,
I am using the following code to create a FIFO queue.

#include <queue>

queue<int> tx_queue;

tx_queue.push(i);

On compiling the vode I get the following error:

'queue' : undeclared identifier

I thought this was declared in #include <queue>. I do not see where the problem is. Any ideas?

GNiewerth
June 5th, 2008, 09:39 AM
All STL stuff resides in the std namespace, so you either have to fully qualfiy the type name like std::queue<int> or use the the using directive using namespace std.