C与C++中的异常处理17[17]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 taodm 的 blog

   {

   structured_exception::install();

   //

   //  discriminate exception by dynamic type

   //

   try

      {

      *(int *) 0 = 0; // generate structured exception

      }

   catch (structured_exception const &exception)

      {

      cout << "caught " << exception.what() << endl;

      }

   //

   //  discriminate exception by static type

   //

   try

      {

      static volatile int i = 0;

      i = 1 / i; // generate structured exception

本文关键:异常
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top