quiz....
1. A function threw an exception of type std::unexpected.
Question Referring to the scenario above, what is a logical cause?
Choice 1
An exception was thrown in which the type was not in the function's
exception specification.
Choice 2
The application was targeting one operating system, but another
operating system is being used, which generated the exception.
Choice 3
There was no catch all enabled in scope closest to the function call.
Choice 4
An exception of type std::unexpected can never be thrown in a
well-formed C/C++ program.
Choice 5
An exception thrown is not yet caught and the destructor for an object
throws an exception during the stack unwinding.
2. With regard to C++ friendship, which one of the following statements
is FALSE?
Choice 1
If class A is a friend of class B, then class A can see all of class
B's private data and methods.
Choice 2
If class A is a friend of class B, you cannot assume that class B is a
friend of class A.
Choice 3
If class A is a friend of class B, and class C inherits from B, then
class A is a friend of C.
Choice 4
Friendship must be granted, not taken.
Choice 5
You can declare both a friend function and a friend class.
3. Which one of the following is NOT a C++ iterator category?
Choice 1
Random-access Iterator
Choice 2
Bidirectional Iterator
Choice 3
Stream Iterator
Choice 4
Forward Iterator
Choice 5
Input Iterator
4.Which one of the following is NOT a valid C++ cast?
Choice 1
const_cast
Choice 2
dynamic_cast
Choice 3
void_cast
Choice 4
static_cast
Choice 5
reinterpret_cast
5. You were asked to use the template function std::search from the
header <algorithm>, but you need to provide your own comparison
routine.
Question Referring to the scenario above, what should you provide to
std::search()?
Choice 1
An overloaded operator< for the container members
Choice 2
A sorted container
Choice 3
A sorted container containing only integral values
Choice 4
Forward and reverse iterators to the container
Choice 5
A binary function or function object that returns a bool
6. Which one of the following statements about abstract classes is
FALSE?
Choice 1
They can be derived from.
Choice 2
They cannot be instantiated.
Choice 3
They must have at least one function that is explicitly defined.
Choice 4
They have at least one pure virtual function or derive from another
abstract class.
Choice 5
You can have pointers and references to abstract base classes.
7. When casting within an object to or from a base class type, which
one of the following casts performs the task only if the cast is valid?
Choice 1
dynamic_cast
Choice 2
(void*)
Choice 3
const_cast
Choice 4
static_cast
Choice 5
reinterpret_cast
I've my ans..but i want to know the right ans. |