异常处理

// C++练习.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"

void xxx(int a,int b=33){
a=123;
b=321;
}

int _tmain(int argc, _TCHAR* argv[])
{
    int a=1;
    int b=0;    
    try{
            printf("%d",a/0);
    }catch(...){//处理所有的异常
    }

}

 

posted @ 2013-07-28 02:12  宝贝,我永远都在  阅读(85)  评论(0)    收藏  举报