im trying to learn c programming and and im just lost on how i can split my array of ints, size created via malloc in half, and pass each half of the array to a different function each, array created
to create the size i used a size variable, then asked for user input then passed that value into my malloc function.
int* ptr;
ptr =(int*)malloc(size * sizeof(int));
for (int i = 0; i < size; ++i)
{
printf("enter a number\n");
scanf("%d", &temp);
ptr[i] = temp;
}
and then once my array has been created, I need to split it in half and pass it to the functions, but I'm unsure on how to access the array at this stage, as again im still new,
so my ptr variable is that like a location holder, or array name similar to a array like so in java?
int[] pointername = new int[20];
where the pointername is in c my ptr variable? just trying to understand or find my array reference