Hi all.
I have code that looks like this:
void bubblesort (int arr[], string stringarr[])
{
for (int i=0;i<5;i++)
{
for (int j=0;j<i;j++)
{
if (arr[i] > arr[j])
{
int temp=arr[i];
arr[i]=arr[j];
arr[j]=temp;
string strtemp=stringarr[i];
stringarr[i]=stringarr[j];
stringarr[j]=strtemp;
}
}
}
}
It is a bubble sort trying to find the highest value, with the string name attached to it.
For example, a=5, b=10, c=50, d=39.
How is it possible to clear all the variables and reset the code for another use in the program?
For example, if I encounter w=600, x=421, y=222, z=742 later on.