jeudi 3 mars 2022

While using foreach loop why we use (auto) in 2D array? [closed]

for( auto& i : res){
        for( auto& j :i){
            cout << j << " ";
        }
        cout << "\n";
    }

I want to know then significance and working of auto & how it is helping, apart from shortening the code.
Thanks

Aucun commentaire:

Enregistrer un commentaire