When I compile and run this program, I get a segfault.
But this (I think) equivalent C program runs just fine.
Am I doing something wrong?