CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: C++ queue

  1. #1
    Join Date
    Jun 2008
    Posts
    5

    C++ queue

    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?

  2. #2
    Join Date
    Nov 2006
    Location
    Essen, Germany
    Posts
    1,344

    Re: C++ queue

    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.
    - Guido

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured