Heap memory confusion

sir
firstly a local pointer is created using that a memory block is created in the heap memory.
i have confusion in the way how it is created 9in the heap memory like
we write int *ptr;
ptr=malloc(sizeof…);
sir how memory block is created here
ptr =something
so sir shouldn’t there be an address on the RHS
but here how a memory block is created
sir plz clear my doubt.

Hi Yatin
Could you elaborate your doubt little more ? Maybe then I would be able to help you !

mam i mean to say how a memory is created in the heap memory by writing
int * ptr; //creates a local pointer
then ptr=malloc(size of (10))//creates a pointee for the ptr in heap memory
we equate
ptr=…
normal on the RHS there is an address but this time how a memory block is created

Hi yatin
int * ptr;
ptr=(int * )malloc(sizeof(int) * x);
x here can be any number.
We use int* here to type cast it.
This is the correct syntax.
Is this what you want to ask?