Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 25th, 2005, 06:55 AM
vibgyorbits
Guest
 
Posts: n/a
Default 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.

  #2  
Old July 25th, 2005, 07:15 AM
vindhya
Guest
 
Posts: n/a
Default Re: quiz....

1.An exception was thrown in which the type was not in the function's
exception specification.
2.If class A is a friend of class B, and class C inherits from B, then
class A is a friend of C.
3.Dunno ???? May be Input Iterator
4.void_cast
5.A sorted container
6.They must have at least one function that is explicitly defined.
7.const_cast ?????

  #3  
Old July 25th, 2005, 06:25 PM
vibgyorbits
Guest
 
Posts: n/a
Default Re: quiz....

5. A binary function or function object that returns a bool
I thought this because you need to provide your own comparison routine.

Any clarifications?

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles