Question: Using the code below, Modify the Static Arrays to Dynamic. Replace all instances of array notation with pointer notation. #include //Input - Output Library #include

Using the code below,

Modify the Static Arrays to Dynamic.

Replace all instances of array notation with pointer notation.

#include //Input - Output Library
#include //Random number function
#include //Time to set the seed
using namespace std; //Name-space under which system libraries exist
//User Libraries
//Global Constants
//Function Prototypes
void filAray(int [],int);
void prntAry(int [],int,int);
void mrkSort(int [],int);
//Execution begins here
int main(int argc, char** argv) {
//Set the random number seed
srand(static_cast(time(0)));
//Declare variables
const int SIZE=100;
int array[SIZE]={};
//Input data
filAray(array,SIZE);
prntAry(array,SIZE,10);
//Map inputs to outputs or process the data
mrkSort(array,SIZE);
//Output the transformed data
prntAry(array,SIZE,10);
//Exit stage right!
return 0;
}
void mrkSort(int a[],int n){
for(int pos=0;pos
for(int indx=pos+1;indx
if(a[pos]>a[indx]){
int temp=a[pos];
a[pos]=a[indx];
a[indx]=temp;
}
}
}
}
void prntAry(int a[],int n,int perLine){
cout<
for(int indx=0;indx
cout<
if(indx%perLine==(perLine-1))cout<
}
cout<
}
void filAray(int a[],int n){
for(int indx=0;indx
a[indx]=rand()%90+10;//Fill with 2 digit number
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!