В чем проблема?
// функция для удаления элемента массива
int remove_element(double *array, int *n, int pos)
{
if (pos >= *n || pos < 0)
{
printf("Incorrect position\n");
return ERROR_POSITION;
}
double *tmp = (double*)calloc(*n, sizeof(double));
if (!pos)
for (int i = 0; i < pos; i++)
tmp[i-1] = array[i];
else
{
for (int i = 0; i < pos; i++)
tmp[i] = array[i];
for (int i = pos; i < *n; i++)
tmp[i-1] = array[i];
}
free(array);
(*n)--;
array = (double*)malloc(*n * sizeof(double));
for (int i = 0; i < *n; i++)
array[i] = tmp[i];
free(tmp);
return SUCCESS;
}