why in this code is run time exception??

#include<stdio.h>
#include<conio.h>
main()
{

char *d,*m;
scanf("%c",d);
printf("%c \n",*d);
printf("enter");
scanf("%c",m);
printf("%c",*m);
getch();
}

i did’nt understand

add ampersand before the variable in scanf("%d",&d)…

simple u have declared d , m but values contained in them may not valid memory locations and even if valid u r accessing a ghost char var cause a char pointer should point to char var

you can edit your previous comment when there is something more you want to say :wink: