Getting or not getting an exception is compiler dependent. Are you using(I
think so) GCC ?
Paul Herring <[EMAIL PROTECTED]> wrote: On 06
Mar 2007 10:43:51 -0800, Tamas Marki <[EMAIL PROTECTED]> wrote:
> On 06 Mar 2007 10:18:45 -0800, vermilions276 <[EMAIL PROTECTED]> wrote:
> > shudn't this piece of code give me a null pointer exception?it ran
> > without any exception and printed 0.not even after the program has
> > finished execution.Under what circumstances can this happen? am i
> > just missing something?
If you're deliberately trying to invoke an exception, you could always
try assigning something to *p....
> The result of dereferencing a null poiner is undefined. That includes
> 'runs without any exception and prints 0'.
... though as pointed out above, if you're not getting an exception
reading it, you may not get an exception writing to it.
--
PJH
Aio, quantitas magna frumentorum est
Karmennevaya Dhikaraste, Maaphaaleshu Kadaachanah
---------------------------------
Heres a new way to find what you're looking for - Yahoo! Answers
[Non-text portions of this message have been removed]