My professor has given me the code and I wanna run it. I use Visual Studio2008. Code contains data structure "queue". He defines one queue as "queue<int> Q;"

But my compiler gives an error and says "error C2065: 'queue' : undeclared identifier"

Do we need any separate header file to run this? Or what's wrong?

-Thanks,
Sam

Recommended Answers

All 2 Replies

Yes, you need the header queue.

Does this code use the STL queue (looks like it) or a custom-written one?

Either way, it sounds like you are either missing a header, or you haven't resolved your namespace properly.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.