mardi 3 novembre 2015

Can a for loop have an assignment in its statement

I came upon this syntax

for (string st; getline(is, st, ' '); v.push_back(st)); 
        ^                  ^                  ^
    initialization   condition, increment    ???

How does the v.push_back(st) work as an increment when that's being covered by getline(is, st, ' ')?

Aucun commentaire:

Enregistrer un commentaire