I am trying to code an algoritihm, and I was originally using dev C++ which allowed me to use a variable for an Array, however, I copied it over to visual studio community, and now it's broken throwing an error saying it needs a const.
Do you guys have any suggestions on a fix? I have been trying to look up a way to implement it into this.
void mergeSortOG(int inA[], int n)
{
if (n == 0)
{
return;
}
int tempA[n]; //temporary array
for (int i = 0; i < n; i++)
{
tempA[i] = inA[i];
}
mergeSort(tempA, 0, n, inA);
for (int i = 0; i < n; i++)
{
inA[i] = tempA[i];
}
}