int main() {
char *x;
*x = 'h';
printf("%p, %c", &x, *x); // prints nothing
return 0;
}
When I print the address of x I get a real hex address. But I can't print the x after assigning it. Why can't I assign a value without doing this:
int main() {
char *x;
char y = 'y';
x = &y;
*x = 'h';
printf("%p, %c", &x, *x); //prints address and 'h'
return 0;
}