Hi,
I am having difficulty to understand pointers in c language
I wrote my own code
Code:
#include<stdio.h>
#include<stdlib.h>
int main ()
{
int *p = NULL;
p = malloc (sizeof(*p));
if (p == NULL)
{
printf("Memory is not allocated \n");
}
else
{
printf("Memory is allocated \n");
*p = 20;
printf(" address = %p \n", p);
printf(" content = %d \n", *p);
}
free(p);
return 0;
}
address = 007313A8
content = 20
1. Does it means that the pointer p points to the address 007313A8 where there are 20 stores ?
2. Is line number 8 a null pointer?
3. Is line number 27 a dangling pointer?