int main()
{
char * x = NULL;
if (x==NULL)
printf("is NULL\n");
return EXIT_SUCCESS;
}
This function is correct for what it does. It assigns the address of 0 to the char pointer x. That is, it points the pointer x to the memory address 0.
Alternative:
int main()
{
char* x = 0;
if ( !x )
printf(" x points to NULL\n");
return EXIT_SUCCESS;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: