samedi 19 août 2017

Find value in a vector

I need to find a value in a vector in C++. The problem is that I don't need to check the whole vector. I know that the value should be at vector[0], then vector[5], then vector[10] etc, otherwise it doesn't exist. i tried to make a loop like:

for(unsigned i = 0; i< vector.size(); i+5)

But it doesn't work. i know about find function, but I have no idea how to use it in my case

Aucun commentaire:

Enregistrer un commentaire