what is at 0 address in a program?

S

Simon Biber

Kenneth said:
I've seen better "solutions" to this by printing "<nil>" for NULL "%s"
values. This makes the cause more obvious.

And it's easy to implement without actually dereferencing the given
pointer, so you can keep your useful core-dump behaviour for when the
program actually does try to dereference a null pointer.
 
M

Mabden

Simon Biber said:
And it's easy to implement without actually dereferencing the given
pointer, so you can keep your useful core-dump behaviour for when the
program actually does try to dereference a null pointer.

And, if you read K&R, it is implied that Null and all bits zero are the
same. In a very long thread in a distant time of the "long ago", Keith
Thompson quite successfully showed how this is not a truth.

I suggest that the person who coded that software was under the same
misguided idea. It is however, not guaranteed by the standard.
 
P

pete

Mabden wrote:
And, if you read K&R,
it is implied that Null and all bits zero are the same.

And, if you read K&R,
you'll find that "Null" isn't in it.

What do you think you're talking about?
null character ?
null pointer ?
NULL ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,169
Messages
2,570,920
Members
47,464
Latest member
Bobbylenly

Latest Threads

Top