strenge exception phenomenon in win7

Posted by Level 2 on Stack Overflow See other posts from Stack Overflow or by Level 2
Published on 2010-06-17T04:19:26Z Indexed on 2010/06/17 4:23 UTC
Read the original article Hit count: 188

Filed under:
|
|

Hello all,

I spot some interesting artcles about exception handle in codeproject

http://www.codeproject.com/KB/cpp/seexception.aspx

after reading, I decided to do some experiment.

The first time I try to excute the following code

char *p;
p[0] = 0;

The program died without question.

But

After serveral time I execute the same problem binary code. It magically did fine.

even the following code is doing well. any clue or explain?

char *p
p[1000] = 'd';
cout<<p[1000]<<endl;

my os is windows 7 64bit and compiler is vs2008 rc1.

© Stack Overflow or respective owner

Related posts about Windows

Related posts about exception