boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - C++ Q15: throw
相关主题
Two questions about handling exceptions in C++
一道编程题 - throw Exceptions
A try-catch problem in C++
请教:函数后面的 throw() 有意义么?
C++ 用户定义exception的标准用法是什么?
大家对 exception 都是怎么处理的?
C++ Q17: throw 2
请教一个c++ throw exception 问题
C++ try {} catch(...){} 能扑捉一切异常吗?
Exception
相关话题的讨论汇总
话题: throw话题: problem话题: exceptions话题: any话题: result
进入Programming版参与讨论
1 (共1页)
c**********e
发帖数: 2007
1
extern void problem(int, int) throw();
Referring to the declaration of the function "problem" above, which one of
the following statements is a result of using throw()?
a) "problem" cannot throw any exceptions.
b) "problem" can throw any exception.
c) "problem" can re-throw any exception.
d) If "problem" throws any exceptions, they will result in unexpected().
e) "problem" cannot throw any exceptions but can re-throw exceptions.
r****t
发帖数: 10904
2
a
d*****d
发帖数: 46
3
d

【在 c**********e 的大作中提到】
: extern void problem(int, int) throw();
: Referring to the declaration of the function "problem" above, which one of
: the following statements is a result of using throw()?
: a) "problem" cannot throw any exceptions.
: b) "problem" can throw any exception.
: c) "problem" can re-throw any exception.
: d) If "problem" throws any exceptions, they will result in unexpected().
: e) "problem" cannot throw any exceptions but can re-throw exceptions.

c**********e
发帖数: 2007
4
This question shows the consequences of throwing an exception prohibited by
the throw specification.
d) If "problem" throws any exceptions, they will result in unexpected().
This is the correct answer. "problem" may actually throw or re-throw, but
doing so will result in unexpected() (C++ Standard 15.5.2/1).
r****t
发帖数: 10904
5
才发现本版两年前就讲过了。考古再发言阿!
http://www.mitbbs.com/article_t/Programming/28303699.html
1 (共1页)
进入Programming版参与讨论
相关主题
Exception
真是痛恨喜欢 throw 的猪
王银看kotlin(本文建议零售价 ¥15)
c++:exception 一问
c++ exception 一问
c++ exception
关于 exception 的一个问题
编程题一道
try catch question
Exception 问题求助
相关话题的讨论汇总
话题: throw话题: problem话题: exceptions话题: any话题: result