[prog] Bug!!

Robert J. Hansen cortana at earthlink.net
Sun Mar 2 06:55:51 EST 2003


>                                                              My program
> ,instead of printing segmentation fault  ,faithfully prints both the
> strings.How it is possible?

It's possible because the C spec says that reading unallocated memory
produces undefined results.  It can work properly.  It can give a
segfault.  It can initiate a nuclear first-strike on Des Moines. 
Etcetera.  No matter what it does, it's going to be legitimate.




More information about the Programming mailing list