void deleteNegative(queue <int> &q)
{
queue <int> temp;
if (!q.empty())
{
int x = q.front();
if (x >= 0)
{
temp.push(x);
q.pop();
}
else
{
q.pop();
}
}
while(!temp.empty())
{
q.push(temp.front());
temp.pop();
}
}
just afunction that returns a queue without the negatives in the same order. unsure where ive gone wrong