char *ptr = malloc(sizeof(char));
printf("\nValue of ptr: %d\n",ptr);
printf("\nValue of address of ptr: %x\n",&ptr);
printf("\nValue of pointed by ptr: %c\n",*ptr);
printf("\nValue of address pointed by ptr: %x\n",&(*ptr));
*ptr='u';
printf("\nValue of pointed by ptr: %c\n",*ptr);
printf("\nValue of address pointed by ptr: %x\n",&(*ptr));
In the above piece of code, the following output is received:
Value of ptr: 1046113600
Value of address of ptr: a2fffa78
Value of pointed by ptr: P
Value of address pointed by ptr: 3e5a6d40
Value of pointed by ptr: u
Value of address pointed by ptr: 3e5a6d40
Does this imply that the default value of the malloc with a single char size is P?
Tried to allocate memory of single char size using malloc and initialized a pointer pointing to the allocated memory. Tried to print the value of the allocated memory.