Dereferencing a null pointer

前端 未结 5 2026
时光说笑
时光说笑 2021-01-18 05:10

Why I can\'t dereference a null pointer? That is, why I can\'t read/write memory which address is simply 0?

Does the base pointer of my process have a different addr

5条回答
  •  日久生厌
    2021-01-18 05:39

    A null pointer is not a pointer to "memory [whose] address is simply 0". It's just a special pointer that doesn't point to anything valid.

    The C language says that there are no requirements on the behaviour of a program that dereferences a null pointer.

提交回复
热议问题