jeudi 5 septembre 2019

What happens when you add an integer value to an array?

In many posts I have seen answers like

std::sort(arr1, arr1 + size1);

I do not understand what is happening at arr1 + size1 where an array is being added with an integer, is it concatenation, or is it adding size1 to each element of the array? Neither of them seem like a logical thing required to sort an array. I tried printing the result but, it isn't possible to print arrays in C++. Could someone please explain what is going on here?

Aucun commentaire:

Enregistrer un commentaire