Null reference for first memory address between 0 - 65535

Posted by Terry on Stack Overflow See other posts from Stack Overflow or by Terry
Published on 2010-05-18T13:55:22Z Indexed on 2010/05/18 14:01 UTC
Read the original article Hit count: 198

Filed under:

I would like to understand a bit more about memory and I was unable to find it from Google, please forgive me if this is silly question.

How come the following code, accessing memory address 0(and up to 65535) in C# would throw NullReferenceException

byte* pointer = (byte*)0;

byte test = *pointer;

Thanks a lot in advance!

© Stack Overflow or respective owner

Related posts about memory