In C++, write a method that compute squares using pointers

Question

Create a method that takes in a reference int and an int array. Return the memory address of the first element of the array.

Explanation

Within the computerSquares function, create a for loop that loops from 0 to the length of the array, n. Within the for loop, assign the value ((k+1)²) into the current element the for loop is iterating at. Once the for loop has finished iterating, then return the memory address of the first element of the array &arr[0].

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store