Deck 18: Exception Handling

ملء الشاشة (f)
exit full mode
سؤال
A function declared thus: void func(argument_list)throw();should throw no exception of any type.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Compilers will check code in functions against exception specifications.
سؤال
A function uses an exception specification that includes only int,but an exception of type double is thrown.A catch block is provided that catches a double,so things proceed properly.
سؤال
The default action of unexpected()can be changed.
سؤال
When an event occurs that cannot be managed locally,an exception may be thrown.Throwing the exception object transfers control and information gleaned locally to some calling program unit that manages the event,or the program terminates.
سؤال
An exception is signaled or raised with the keyword catch followed by an exception object that may be of any C++ type.
سؤال
Mentioning a base class B in an exception specification includes a class D objects,where D is derived from B,in the exception specification.
سؤال
A circumstance in C++ where an exception is thrown must be an error.
سؤال
The exception specification for a function has no effect on an exception that is caught within the function.
سؤال
If an exception is thrown in a function,say,f(),but not handled there,the exception is propagated to the function that called f().
سؤال
In C++ an exception object must be derived from the exception class defined in the standard library.
سؤال
In C++,an exception object can be a user-defined type or any type that is built-into C++ language.
سؤال
Statements that cause an exception must be part of a try block.
سؤال
A function does not have an exception specification at all,so exceptions are prohibited.
سؤال
The context in which the throwing of an exception is detected is the try block.
سؤال
The context in which an exception is handled (or managed)is the throw block.
سؤال
An uncaught exception in C++ is ignored.
سؤال
A program can continue to run after an exception has been thrown and caught.
سؤال
Suppose an exception of type E is thrown in a function but not listed in the exception specification,and is not caught in the function.The exception will be caught in a calling function that has a catch block that declares an exception of that type.
سؤال
In type matching to select a catch block,only exact matches work.
سؤال
Describe the circumstances that the unexpected()function will be called.
سؤال
How can you write a catch block that will catch all exceptions that have been thrown but not yet caught?
سؤال
Write a definition for an exception class,E,that contains an error number and a string type error name.Include a constructor that creates an E object and initializes both members.Provide accessors for both the message and error number.
سؤال
What is the purpose of exception handling?
سؤال
The situations where exceptions are used put the try block with the throw statement followed by the catch block all in one function.
سؤال
Explain how the mechanism for deciding which catch block catches an exception is like the mechanism for deciding which function definition is used when an overloaded function is called.
سؤال
A function that satisfies its preconditions but cannot fulfill its postconditions should throw an exception.
سؤال
Write just a catch block with a catch block parameter type that will catch all exceptions that are yet uncaught.
سؤال
When an exception is thrown,the function finishes its execution,its value is returned,then control is transferred to the catch block.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/29
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 18: Exception Handling
1
A function declared thus: void func(argument_list)throw();should throw no exception of any type.
True
2
Compilers will check code in functions against exception specifications.
False
3
A function uses an exception specification that includes only int,but an exception of type double is thrown.A catch block is provided that catches a double,so things proceed properly.
False
4
The default action of unexpected()can be changed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
5
When an event occurs that cannot be managed locally,an exception may be thrown.Throwing the exception object transfers control and information gleaned locally to some calling program unit that manages the event,or the program terminates.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
6
An exception is signaled or raised with the keyword catch followed by an exception object that may be of any C++ type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
7
Mentioning a base class B in an exception specification includes a class D objects,where D is derived from B,in the exception specification.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
8
A circumstance in C++ where an exception is thrown must be an error.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
9
The exception specification for a function has no effect on an exception that is caught within the function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
10
If an exception is thrown in a function,say,f(),but not handled there,the exception is propagated to the function that called f().
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
11
In C++ an exception object must be derived from the exception class defined in the standard library.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
12
In C++,an exception object can be a user-defined type or any type that is built-into C++ language.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
13
Statements that cause an exception must be part of a try block.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
14
A function does not have an exception specification at all,so exceptions are prohibited.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
15
The context in which the throwing of an exception is detected is the try block.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
16
The context in which an exception is handled (or managed)is the throw block.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
17
An uncaught exception in C++ is ignored.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
18
A program can continue to run after an exception has been thrown and caught.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
19
Suppose an exception of type E is thrown in a function but not listed in the exception specification,and is not caught in the function.The exception will be caught in a calling function that has a catch block that declares an exception of that type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
20
In type matching to select a catch block,only exact matches work.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
21
Describe the circumstances that the unexpected()function will be called.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
22
How can you write a catch block that will catch all exceptions that have been thrown but not yet caught?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
23
Write a definition for an exception class,E,that contains an error number and a string type error name.Include a constructor that creates an E object and initializes both members.Provide accessors for both the message and error number.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
24
What is the purpose of exception handling?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
25
The situations where exceptions are used put the try block with the throw statement followed by the catch block all in one function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
26
Explain how the mechanism for deciding which catch block catches an exception is like the mechanism for deciding which function definition is used when an overloaded function is called.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
27
A function that satisfies its preconditions but cannot fulfill its postconditions should throw an exception.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
28
Write just a catch block with a catch block parameter type that will catch all exceptions that are yet uncaught.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
29
When an exception is thrown,the function finishes its execution,its value is returned,then control is transferred to the catch block.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.