How to catch integer divide by zero and access violation exceptions in native C?

It's strange not to have the possibility to catch these exceptions. But if it's like that, than I guess you can put your own validations and throw your own exceptions. But again, you may be missing something.

It's strange not to have the possibility to catch these exceptions. But if it's like that, than I guess you can put your own validations and throw your own exceptions. But again, you may be missing something...

See the documentation for _try/_except mechanism. This is used in Windows for catching hardware exceptions.

EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) { //exception routine } and it worked well. I have got the resonse for my question. Thanks for your Help.

– Reza Abzadeh Oct 7 '11 at 10:36.

There is a very easy way to catch any kind of exception (division by zero, access violation, etc. ) in Visual Studio using try -> catch (...) block :) A minor project tweaking is enough. Just enable /EHa option in project settings. See Project Properties -> C/C++ -> Code Generation -> Modify the Enable C++ Exceptions to "Yes With SEH Exceptions".

That's it! See details here: msdn.microsoft.com/en-us/library/1deeycx...).aspx.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions