i try to get numbers from my user and this is my function,
my function get arr as pointer and set it to a new array and return the counter of the number that i get for printing.
but when i try to print the array i get an ERROR that ther is noting
int GetNumber(int *arr)
{
int n,i=0;
int *temp;
temp = (int*)calloc(1,sizeof(int));
assert(temp);
scanf("%d",&n);
while(n != -1)
{
i++;
temp = (int*) realloc(temp,i*sizeof(int));
assert(temp);
temp[i-1] = n;
scanf("%d",&n);
}
arr = temp;
return i;
}