Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
what error you are getting..
The code is "wrong" and must be expected to cause an exception, because you are writing to an undefined memory location by using an uninitialized pointer. A popular C programming error, I think.
int main()
{
char c;
char *p;
p=&c;
*p = 'D';
printf("%c\n",*p);
return 0;
}
int main()
{
char *p = malloc(sizeof(char));
*p = 'D';
printf("%c\n",*p);
return 0;
}
The code may execute in some cases, but is incorrect anyway.
Code:int main() { char c; char *p; p=&c; *p = 'D'; printf("%c\n",*p); return 0; }