by Mesopropithecus · 8y ago · 0 comments
For fairly low values of those. Creating a null reference is UB, your program is not legal at all.
The whole point is to NOT have it be accepted.
Which is a textbook example of the null reference problem.
Edit: There may be some terminological confusion here: when programming language folks talk about "references", they include in that definition what C/C++ call "pointers". See for example the Wikipedia article, which gives as the C++ example not C++ references, but C++ pointers.
Since nobody stopped you, the problem is still there.