[C/C++] try … catch(…) 用法

因為寫的程式都是自己用,所以很少在寫Exception。
今天看到某個在職畢業學長的Codes 有下面的東西。

try {} catch(...){
}

當時猜說該不會是for any exception的意思吧?
去google了一下,果然八九不離十。
http://se.csai.cn/ExpertEyes/No138.htm
建議有興趣的人可以看上面的連結。
主要是在講說當你有很多個exceptions 要處理時,為了避免漏抓exception或是為了
一次抓取所有丟出來的的exception,便使用C++中的catch(…)的特殊用法。

This entry was posted in C/C++, 程式設計. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *