mardi 26 février 2019

Range based for-loop with &

I haven't found a question that answers the part I'm confused on, and I apologize if someone did answer it.

I'm confused on whats going on in this for-loop, how is it looping through the addresses?

int arr[] = {1,2,3,4,5};
for(const int &arrEntry : arr){
     cout << arrEntry << " ";
}

Aucun commentaire:

Enregistrer un commentaire