Why does this simply c program segfault when I call printf
?
#include<stdio.h>
int main() {
char* f;
char* b;
*f = 'x';
b = f;
*b = 'y';
printf("%c", *f);
}
I'd expect 'y' to be printed. I dereference f
to obtain the character, right?