try catch整个函数

简介: try catch整个函数
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])  try
{
     char* p = NULL ;
     *p = 'a';
    return 0;
}
catch(...)
{
   cout << "catch...";
}

注意:

VC6不支持。

相关文章
|
7月前
每日一道面试题之try-catch-finally 中,如果 catch 中 return 了,finally 还会执行吗?
每日一道面试题之try-catch-finally 中,如果 catch 中 return 了,finally 还会执行吗?
|
4月前
|
编译器
try{...}catch(){...}finally{...}语句你真的理解吗?
try{...}catch(){...}finally{...}语句你真的理解吗?
23 0
|
10月前
try catch finally,try 里面有 return,finally 还执行吗?
try catch finally,try 里面有 return,finally 还执行吗?
36 0
|
5月前
|
存储 缓存 IDE
细琢磨,try catch finally 执行顺序与返回值
细琢磨,try catch finally 执行顺序与返回值
41 0
|
6月前
try和catch的用法
try和catch的用法
48 1
|
7月前
16 # 实现 catch 方法
16 # 实现 catch 方法
30 0
|
11月前
try...catch中,catch加了return,后面的代码是不会执行的
try...catch中,catch加了return,后面的代码是不会执行的
67 0
|
Java
【学习笔记】【Java】try-catch-finally中,finally是在什么时候执行的:try结束、catch结束、return前
结论:try-catch-finally中,finally执行:try结束、catch结束、return前
160 0
【学习笔记】【Java】try-catch-finally中,finally是在什么时候执行的:try结束、catch结束、return前
|
Web App开发 JavaScript 前端开发
啊,似乎没有真正理解 try...catch...finally!
啊,似乎没有真正理解 try...catch...finally!
435 0
啊,似乎没有真正理解 try...catch...finally!
try-catch-finally 和 return 是怎么执行的?
来源:http://liangfei.me/ 最近一直在看Java虚拟机规范,发现直接分析bytecode更能加深对Java语言的理解。 之前看过一篇关于 return 和 finally 执行顺序的文章,仅在 Java 的语言层面做了分析,其实我倒觉得直接看 bytecode 可能来的更清晰一点。