How to catch divide-by-zero error in Visual Studio 2008 C++?

后端 未结 9 2362
清歌不尽
清歌不尽 2020-12-19 06:26

How can I catch a divide-by-zero error (and not other errors; and to be able to access exception information) in Visual Studio 2008 C++?

I tried this:



        
9条回答
  •  北海茫月
    2020-12-19 06:52

    You can either use structured exception handling (using __try etc.) or you can install a structured exception handler translator: _set_se_translator

    Both of these are operating system specific.

提交回复
热议问题