|
|
Invisible <voi### [at] devnull> wrote:
> You know what? In Java, if you reference a null pointer, a little
> message pops up that says "hey, you just dereferenced a null pointer".
> And it even tells you where it happened. In C, your program just behaves
> bizarely.
Actually no. IIRC the C standard defines that accessing the null pointer
is illegal (and will usually cause a segmentation fault). If you are running
a proper debugger, it will tell you the exact line where the null pointer
was accessed.
> Ditto for EOF
You mean reaching the end of the file is such a fatal error, that the
program must be terminated with an exception?
> array index out of bounds
Unless you use a proper debugger.
> out of memory...
Causes a null pointer access in C.
> (And you don't have to memorise whether 0 is true or false.
I see how that's such a hard thing to memorize.
> Memory leaks? What memory leaks?
Yeah. Java leaks memory constantly. In fact, *everything* is leaked.
> No dangling pointers here either.
Except for the null references.
--
- Warp
Post a reply to this message
|
|