why the ptr have the same size even tho I was expecting the size of ptr to be 5*size(int)/4 = 20 but I got the current size is 8 and also the new size is 8, any explanation pls?
int *ptr;
ptr = (int*)malloc(5 * sizeof(int));
printf("current size is %ld\n", sizeof(ptr));
for (int i = 0; i < 5 ; i++)
{
ptr[i] = i + 1;
}
for (int i = 0; i < 5 ; i++)
{
printf("%d\n",*(ptr + i));
}
ptr = (int*)realloc(ptr, 10 * sizeof(int));
printf("new size is %ld\n", sizeof(ptr));
for (int i = 0; i < 5 ; i++)
{
printf("%d\n", *(ptr + i));
}