#include<stdio.h>
int main()
{
int a, *pA;
a = 5;
pA = &a;
printf("pA = &a; ---> pA = %p, *pA = %d\n", pA
, *pA
); pA = a;
printf("pA = a; ---> pA = %p\n", pA
);
// printf("*pA = %d\n", *pA);
// ↑ printfの中で、アクセスが許可されていないメモリ(0x00000005番地)を
// アクセスしようとするので Segmentation fault が起きる
return 0;
}
I2luY2x1ZGU8c3RkaW8uaD4KaW50IG1haW4oKQp7CiAgICBpbnQgYSwgKnBBOwoKICAgIGEgPSA1OwogICAgcHJpbnRmKCJhID0gJWRcbiIsIGEpOwogICAgcEEgPSAmYTsKICAgIHByaW50ZigicEEgPSAmYTsgLS0tPiBwQSA9ICVwLCAqcEEgPSAlZFxuIiwgcEEsICpwQSk7CiAgICBwQSA9IGE7CiAgICBwcmludGYoInBBID0gYTsgIC0tLT4gcEEgPSAlcFxuIiwgcEEpOwoKLy8gICAgcHJpbnRmKCIqcEEgPSAlZFxuIiwgKnBBKTsKICAgICAgLy8g4oaRIHByaW50ZuOBruS4reOBp+OAgeOCouOCr+OCu+OCueOBjOioseWPr+OBleOCjOOBpuOBhOOBquOBhOODoeODouODqigweDAwMDAwMDA155Wq5ZywKeOCkgogICAgICAvLyDjgqLjgq/jgrvjgrnjgZfjgojjgYbjgajjgZnjgovjga7jgacgU2VnbWVudGF0aW9uIGZhdWx0IOOBjOi1t+OBjeOCiwoKICAgIHJldHVybiAwOwp9