Accessing queue within a vector

Hi I have this linked queue which I placed into a vector (something I needed to do to for my project). Now I want to access a specific index in the vector and enqueue something into the linked queue but I am having issues accessing the linked queue. Here is what I have below
*my linked queue needs to be of my class cars
1
2
3
4
5
6
 cin>> x;
  vector<LinkedQ<cars>*> vect_data; 
 for(x; x!=0; x--){
       LinkedQ<cars>* data;
       vect_data.push_back(data);
    }

Now when I am trying to access it to enqueue the some data
1
2
int y=1;
vect_data[y]->enqueue(5);//this is where I am getting stuck and it crashes 
You are storing pointers to linked queues inside the vector but where are the pointers pointing to?
What do you mean?
Simpler example:
1
2
3
4
5
std::vector<int *> foo;
int * bar;
// where does the bar point to?
foo.push_back(bar);
// where does the foo[0] point to? 
Topic archived. No new replies allowed.