{
int*ptr = (int*)malloc(10*sizeof(int));

ptr = realloc(ptr, 20*sizeof(int));

}

As realloc function is used to dynamically reallocate the memory and ptr is a pointer which points the dynamically allocated memory, but in case of realloc function why we have written (ptr, 20*sizeof(int))...

Why we have written ptr here?? Like a malloc function it should be some integer value.