A reference can not be NULL or it can be NULL?

后端 未结 7 933
忘了有多久
忘了有多久 2020-12-13 16:03

I have read from the Wikipedia that:

“References cannot be null, whereas pointers can; every reference refers to some object, although it may or may n

7条回答
  •  既然无缘
    2020-12-13 16:30

    that would crash your program. Did you try running it? doing *object will deference a null pointer, so in fact your reference never gets assigned.

提交回复
热议问题