Okay it looks like a copied the initial random numbers, but unable to sort it for some reason i couldn't figure it out. Im not sure if my for loop is working properly.
//function prototype
void initialize_array(int [],int);//to initialize an array
int *sort_array(int [],int);//to sort the array
void print_array(int [],int);//to display the unsorted and sorted array
using namespace std;
int main()
{
int *array1 = nullptr;//To point to the numbers
int *array2 = nullptr;
int num1;//declare a variable
//ask the user for the amount of integer numbers
cout<<"Enter the amount of integer numbers: ";
cin>>num1;
//dynamically allocate the array
array1 = new int[num1];
array2 = new int[num1];
//call function to initialize the arrays
initialize_array(array1,num1);
initialize_array(array2,num1);
//call function to display unsorted random numbers
cout<<"\n\n the initial array with random numbers are\n";
print_array(array1,num1);
for(int x=0;x<num1; x++)
{
array1[x]=array2[x];
}
//call function to display sorted random numbers
cout<<"\n\n the output random numbers are\n";
sort_array(array2,num1);
okay it looks like the random numbers are sorted out -----> solved
but next problem is to find the pivot point or number and then split one array into two arrays not including the pivot number. Any suggestion is greatly appreciated