Returning Pointers from a Function in C++
A C++ program may return a pointer, just is may have them passed to the function. To specify a pointer, you define that data type in the return type. For example: The book gives an example on how to return an array this way, however, as it uses an existing array, the array is already…