Somewhere in my program, I have written the following line but it gives the error: vector subscript out of range and I can't figure out why.
Code:
if(!(list_of_queues[matches[k]->FirstQ]->empty()) && list_of_queues[(matches[k])->SecondQ]->empty())
{
...
}
"list_of_queues" and "matches" are both vectors of pointers. "FirstQ" is an attribute of class "a" which is stored in vector "matches" as "a*".
the interesting thing is that I have written the following code before this one and it gives no errors on that.
Code:
if(list_of_queues[matches[k]->FirstQ]->empty() && !(list_of_queues[matches[k]->SecondQ]->empty()))
{
...
}
can somebody plz tell me what is wrong with that?