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 | | 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 | |
|