Q: Which header file is used to declare the standard exception?
Solution: #includeis used to declare the standard exception.
Q: Where are standard exception classes grouped?
Solution: As these are standard exceptions, they need to be defined in the standard block, So it is defined under namespace std.
Q: How many types of standard exception are there in c++?
Solution: There are nine standard exceptions in c++. They are bad_alloc, bad_cast, bad_exception, bad_function_call, bad_typeid, bad_weak_ptr, ios_base::failure, logic_error and runtime_error.
Q: Which of the following is best to include under try block?
Solution: Because the dynamic allocations can change at any time, So it is best to include in try block.
Q: What are the predefined exceptions in c++?
Solution: Both Memory allocation errors & I/O errors are the predefined exceptions in c++.
Q: What will happen when introduce the interface of classes in a run-time polymorphic hierarchy?
Solution: Separation of interface from implementation introduce the interface of classes in a run-time polymorphic hierarchy.
Q: Which classes are called as mixin?
Solution: A class that expresses functionality rather than its primary design role is called a mixin.
Q: What is the use of clog?
Solution: clog is an object of class ostream that represents the standard logging stream. It is associated with the cstdio stream stderr, like cerr.
Q: Which operator is used to create the user-defined streams in c++?
Solution: We can make user-defined types with streams by overloading the insertion operator (<<) to put objects into streams and the extraction operator (>>) to read objects from streams.
Q: What does the cerr represent?
Solution: cerr is an object of class ostream that represents the standard error stream. It is associated with the cstdio stream stderr.
You Have Score    | /10 |