pointers in cpp 4
pointers in cpp 4
its size, and pointer to another function that squares the elements of the array.
What about finding the biggest or smallest elements in arrays? We can use pointers for that
too. Let’s initialize and declare an array, use a pointer to find the greatest element in it and
print its value:
In the following example, we will take a look at simple swapping of elements. Just like in
regular examples without pointers, it is done with a variable that temporarily holds one