Solved

vector of queues?

Posted on 2002-03-16
3
1,220 Views
Last Modified: 2013-12-14
I'd like to have a vector of queues in my program but my compiler ( Microsoft Visual C++ 6.0 ) isn't allowing it.  What is wrong with this syntax?

void sysGen(vector<queue<int>>, vector<queue<int>>,
         vector<queue<int>>);
0
Comment
Question by:abstractionz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 6872030
The problem is ">>" - the compiler mistakenly interprets that as the right-shift operator ("max-munch"). make your code read

void sysGen(vector<queue<int> >, vector<queue<int> >,
        vector<queue<int> >);  // note the spaces!

0
 
LVL 86

Accepted Solution

by:
jkr earned 100 total points
ID: 6872039
Oh, or you could also

typedef queue<int> int_queue;

void sysGen(vector<int_queue>, vector<int_queue>,
        vector<int_queue>);

or

typedef queue<int> int_queue;
typedef vector<int_queue> vector_of_int_queues;

void sysGen(vector_of_int_queues, vector_of_int_queues,
        vector_of_int_queues);



0
 

Author Comment

by:abstractionz
ID: 6872046
thanks a lot.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
egit plugin on eclipse 8 127
Error creating a new C++ project in ,net 20 59
How to properly read C++ console input into several variables with scanf 2 41
boost::uuid crashes 17 63
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question