Write a function that accepts an array of integers and its size as arguments. The function should create a new array that is one element larger than the argument array. The first element of the new array should be set to 0. Element 0 of the argument array should be copied to element 1 of the new array, element 1 of the argument array should be copied to element 2 of the new array, and so forth. The function should return a pointer to the new array
Use ONLY pointer parameters instead of arrays in both functions; use pointers (not subscripts) to move through elements of both arrays. Before calling the function, display your original array. When the function call is completed, display the new array.
#include <iostream>
usingnamespace std;
int *shifted (int * , int);
constint SIZE = 10;
int main ()
{
int array_size [30];
int size;
int new_number;
cout <<"What is the element of array do you want?" << endl;
cin >> size;
for (int index = 0; index < size; index ++)
{
cin >> array_size[index];
}
new_number = *shifted(array_size , size);
cout <<"The new element is " << new_number << endl;
return 0;
}
int *shifted (int *shifting_arr , int size2)
{
int *new_array=newint[size2+1];
for (int index =0 ; index <size2 ; index ++)
{
new_array [index] = shifting_arr[index];
}
return new_array;
}