Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++ - Some Problem with exception
hi i tried simple code char *c= NULL; try{ *c= 10; } catch(...){ coutt<<"NULL POINTER ACCESS"; } but this doesn't work as expected. same code works in VC++. i have compiled it with -Ae option. Oct 13 2002
What happens when you run it? "Neo" <newneo2 yahoo.com> wrote in message news:aoekhu$di0$1 digitaldaemon.com...hi i tried simple code char *c= NULL; try{ *c= 10; } catch(...){ coutt<<"NULL POINTER ACCESS"; } but this doesn't work as expected. same code works in VC++. i have Oct 14 2002
I think VC might use try and catch for language exceptions as well as regular (hardware) exceptions. Basically there is nothing wrong with the code, except when try/catch would handle the hardware exceptions too. Than *c = 10 would throw an exception. Neo wrote:hi i tried simple code char *c= NULL; try{ *c= 10; } catch(...){ coutt<<"NULL POINTER ACCESS"; } but this doesn't work as expected. same code works in VC++. i have compiled it with -Ae option. Oct 14 2002
In article <aoekhu$di0$1 digitaldaemon.com>, Neo (newneo2 yahoo.com) says...hi i tried simple code char *c= NULL; try{ *c= 10; } catch(...){ coutt<<"NULL POINTER ACCESS"; } but this doesn't work as expected. Oct 14 2002
|