mercredi 28 octobre 2015

Iterating several C++ vectors without visibly getting its length [duplicate]

This question already has an answer here:

I'd like to iterate for example two vecs using auto.

#include <vector>
using namespace std;
int main() {
    vector<int> a,b;
    a.assign(10,0);
    b.assign(10,1);
    for (auto c : a && auto d : b)
       // ....

Aucun commentaire:

Enregistrer un commentaire