(C++) I have a vector of strings of different "categories". Each category is separated by a "00" string in the vector.

So like:

"Pizza"
"IceCream" 
"Bread"
"00"
"Windows"
"Mac"
"Linux"
"Unix"
"00"
"Raining"
"Snowing"
"00"
"Hiking"
"00"

I am trying to figure out how to separate these categories into a vector of strings with all categories in one string like:

"Pizza IceCream Bread"
"Windows Mac Linux Unix"
"Raining Snowing"
"Hiking"

EDIT: alldoubles is the vector name and its size is totalsize

Attempt : Trying to add to a queue whenever the string is not 00

```
int loc = 0; //counter
    queue<string> tmp;
    string cur;
    while (loc<totalsize)
    {
        while (cur != "00")
        {
            tmp.push(cur); //add to queue when not 00
            loc = loc + 1;
            cur = alldoubles[loc];
        }

        while (tmp.empty()!=false)  //unload the queue into a string res 
        {                           // after an 00 was found and cout it
            string res;
            res = res + tmp.front();
            tmp.pop();
            cout << "RES " << res << endl;
        }
    }

```

EDIT : now I get RES and the RES Pizza which is not all the food with this code

```
int loc = 0;
queue<string> tmp;
string cur;
while (loc<totalsize)
{
    while (cur != "00")
    {
        tmp.push(cur);
        cur = alldoubles[loc];
        loc = loc+1;
    }

    while (!tmp.empty())
    {
        string res;
        res = res + tmp.front();
        tmp.pop();
        cout << "RES " << res << endl;
    }
}

```