I have compiled your source and got solutions.
There were 2 errors in your code.
1. Function named 'delete' is not allowed, because 'delete' is C++'s keyword already.
2. Value assign by pointer is not correct.
in 'insert' function,
for(i = *npts-1 ; i > pos ; i--)
{
// (x+i) = (x+i-1); // . original code, error
*(x+i) = *(x+i-1);
}
I will give you code I modified.
I wish my words would help you.
#include "stdafx.h"
#include <stdio.h> /* printf, scanf*/
#include <stdlib.h> /* malloc, free */
void readArray(int **, int *);
void insert(int **, int *, int, int, const int *);
void delete_(int **, int *, int, int);
void printArray(const int *, int);
int main(void)
{
int *Arr, N, operation, pos, n;
readArray(&Arr,&N);
scanf("%d%d%d",&operation, &pos, &n);
if(operation==1)
delete_(&Arr,&N,pos,n);
else
{
int *insert_array = (int *)malloc(n*sizeof(int));
int i;
for(i=0;i<=n-1;++i)
scanf("%d",&insert_array[i]);
insert(&Arr,&N,pos,n,insert_array);
free(insert_array);
}
printArray(Arr,N);
free(Arr);
return 0;
}
void readArray(int **array, int *size)
{
int i;
scanf("%d", size);
for(i=0;i < *size;i++)
{
(*array) = (int*)malloc (*size * sizeof(int));
if(*array == NULL)
{
return;
}
}
}
void insert(int **x, int *npts, int pos, int num_inserted,
const int *element_inserted)
{
int i, num;
printf("the value of pos: %d\n", pos);
printf("the value of element_inserted: %d\n", *element_inserted);
printf("the value of x: %d\n", *x);
printf("the value of num_insert: %d\n", num_inserted);
printf("the value of npts: %d\n", *npts);
for(i = *npts-1 ; i > pos ; i--)
{
*(x+i) = *(x+i-1);
}
*npts ++;
*x[pos - 1] = num_inserted + *(npts);
for(i=0; i < *npts ; i++)
{
printf("%d", *(x+i));
}
}
void delete_(int **x, int *npts, int pos, int num_deleted)
{
}
void printArray(const int *array, int size)
{
}
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}