mardi 5 mars 2019

How can I attribute to an iterator the adress of another one?

I want to attribute to an iterator the adreess of another one +1 to go on into a string vector.Here is my code:

'    for(auto it:cuvinte)
    {
        int nr=1;
        incercare.clear();
        incercare.push_back(it);
        for(auto i2:cuvinte)
        {
            if(incercare.back()[incercare.back().size()-1]==i2[0])
            {
                ++nr;
                incercare.push_back(i2);
            }
            if(nr>maxim)
                {
                    maxim=nr;
                    solutie=incercare;
                }

        }'

I want i2 to get the adreess of it+1 to go in the right of it in the vector. Please help me.

Aucun commentaire:

Enregistrer un commentaire