I am studying C programming. I want to find a middle point of array without knowing about length of it. If length of array is 6, middle point must be 4th, but I have an error and I don't know what it is. Here is my code:
int *a =(int *) malloc(sizeof(int) * n);
int i;
for( i = 0; i < sizeof(a); i++)
scanf("%d",&a[i]);
Anyone can help, thank you.