Thread: c++ problem
View Single Post
Old 10-24-2004, 10:36 PM   #1 (permalink)
sithspawn
 
Super Techie

Join Date: Jun 2004

Posts: 348

sithspawn

Default c++ problem

Hey people,

I am writing a uni program and have encountered a bit of a problem. Ill set you up with a basis of what i am trying to do.

I am writing a simulator for a toll booth system. In this i am using a queue abstract to simulate the queues at the toll booth. The number of queues needs to be specified at run time. I am wondering if there is a way i can attatch a variable to the end of a name to make each queue unique.

Basically i want to do something like this:

for (int i = 1; i <= numQueues; i++)
{
QUEUE que&i;
que&i = createQueue();
}

The bit i am asking about is the &i part. i know this isnt the correct way to code this, if there is a correct way. But if anyone can give me an idea of what to do, it would be VERY helpful.
sithspawn is offline