If you guys see the below code, no memory is allocated( only 0 bytes is allocated) to ptr. But how ptr[0],ptr[1].....ptr[n] can be initialized if there is no space for them.
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main(){
int *ptr;
ptr = malloc(0);
ptr[0] = 0;
ptr[1] = 4;
ptr[2] = 3;
printf("%d %d %d",ptr[0],ptr[1],ptr[2]);
}