For automatic objects, constructors and destructors are called each time the objects
1.enter and leave scope
2.inherit parent class
3.are constructed
4.are destroyed
Return type of uncaught_exception () is ________________.
1.int
2.bool
3.char *
4.double
The code of statements which may cause abnormal termination of the program should bewritten under_________ block.
1.Try
2.catch
3.Finally
4.None of these
What do container adapter provide to interface?
1. Restricted interface
2.More interface
3.No interface
4.None of these
Which among the following is a mandatory condition for downcasting?
1. It must not be done explicitly
2. It must be done implicitly
3.It must be done explicitly
4.It can’t be done explicitly
Which is the pointer which denotes the object calling the member function?
1. Variable pointer
2.This pointer
3.Null pointer
4.Zero pointer
Which of the following best defines the syntax for template function?
1.Template
2.Template return_type Function_Name(Parameters)
3.Both a and b
4.None of These
Which of the followings is/are pointer-to-member declarator?
1. A. ->*
2. .*
3.::*
4.both A and B
Which operation is used as Logical 'AND'
1.Operator-&
2.Operator-
3.Operator-&&
4.Operator +
Which operators is part of RTTI?
1.dynamic_cast()
2.typeid
3.Both dynamic_cast() & typeid
4.None of These
Assigning one or more function body to the same name is called ____________.
1.Function Overriding
2.Function Overloading
3.Both A and B
4. None of the above
At which time does the static_cast can be applied?
1.Compile-time construct
2.Runtime construct
3.Both Compile-time & Runtime construct
4.None of These
Attempting to throw an exception that is not supported by a function call results in calling _____________ library function.
1.indeterminate ()
2.unutilized()
3.unexpected()
4. unpredicted()
Choose the operator which cannot be overloaded.
1. /
2.( )
3.::
4.%
Default values for a function are specified when ____.
1. Function is defined
2.Function is declared
3.Both a and b
4. None of these
How can the member functions in the container be accessed?
1.Iterator
2.Indirect
3.Both Iterator & Indirect
4.None of the mentioned
If inner catch handler is not able to handle the exception then__________.
1.Compiler will look for outer try handler
2. Program terminates abnormally
3.Compiler will check for appropriate catch handler of outer try block
4. None
If multiple inheritance is implemented, which upcasting will be correct?
1.Upcast to first base class listed in inheritance
2.Upcast to any base class
3. Upcast to send base class listed in inheritance
4.Upcast is not possible
In which type of storage location are the vector members stored?
1.Contiguous storage locations
2.Non-contiguous storage locations
3.Contiguous & Non-contiguous storage locations
4.None of the mentioned
lass function which is called automatically as soon as the object is created is called as __
1.Constructor
2.Destructor
3.Friend function
4. Inline function
Pick the odd one out
1.array type
2.character type
3.Boolean type
4.integer type
String class have a concat() function that is used to ______
1.Replace old string by new string
2.Add two strings
3.Append one string at end of another string
4.Remove a string from end of one string
Variable that are listed in function's calls are called
1.Actual parameter
2.Declared parameter
3.Passed parameter
4.None
What does an escape code represent?
1.alert
2.backslash
3.tab
4.form feed
What does the sequence adaptor provide?
1.Insertion
2.Deletion
3.Interface to sequence container
4.None of These
What is the built in library function to compare two strings?
1.string_cmp()
2.strcmp()
3.equals()
4.str_compare()
What kind of error can arise when there is a problem with memory?
1.Segmentation fault
2.Produce an error
3. Both Segmentation fault & Produce an error
4.None of the mentioned
What operation can be performed by destructor?
1.Abort the program
2.Resource cleanup
3.Exit from the current block
4.None of the mentioned
When a language has the capability to produce new data type mean, it can be called as …...
1.overloaded
2.extensible
3.encapsulated
4.reprehensible
When a virtual function is redefined by the derived class, it is called___________.
1.Overloading
2.Overriding
3.Rewriting
4.All of these
When an ADT is implemented as a C++ class, which of the following should normally betrue?
1.Member functions are private, member variables are public
2.Member functions are public, member variables are private
3.Member functions as well as member variables are private
4.Member functions as well as member variables are public
When are the pointer types known for upcasting the objects?
1. Compile time .
2.Runtime
3.Source code build time
4.Doesn’t apply to pointer types
Which among the following is/are type(s) of this pointer?
1. const
2.volatile
3.const or volatile
4.int
Which container provides random access iterators?
1.vector
2.deque
3.sort
4.both vector & deque
Which data type is used to represent the absence of parameters?
1. int
2.short
3.void
4.float
Which function is used to position back from the end of file object?
1. seekg
2.seekp
3.both seekg & seekp
4.None
Which interface in the container is required for storage management?
1. A. Memory management
2.Allocator interface
3.Memory interface
4.None of the mentioned
Which of the following are member dereferencing operators in CPP?1. * 2. :: 3. ->* 4. ::* 5. ->
1.Only 1, 3, 4
2.Only 1 and 5
3.Only 3 and 4
4.Only 3,4,5
Which of the following is incorrect in C++? (1)When we write overloaded function we must code the function for each usage. (2)When we write function template we code the function only once. (3)It is difficult to debug macros (4)Templates are more efficient than macros
1. (1) and (2)
2.(1), (2) and (3)
3.(3) and (4)
4.All are correct.
Which of the following is true about templates? 1) Template is a feature of C++ that allows us to write one code for different data types. 2) We can write one function that can be used for all data types including user defined types. Like sort(), max(), min(), ..etc. 3) We can write one class or struct that can be used for all data types including user defined types. Like Linked List, Stack, Queue,..etc. 4) Template is an example of compile time polymorphism.
1.1 and 2
2.1, 2 and 3
3.1, 2 and 4
4.1, 2, 3 and 4
Which of the following statements are true? int f (float)
1.enumeration
2.classes
3.both enumeration and classes
4.int
Which of the following statements are true? int f (float)
1. f is a function taking an argument of type int and returning a floating point number
2. f is a function taking an argument of type float and returning an integer
3. f is a function of type float
4.none of the mentioned
Which operations don’t throw anything?
1.Operations which are reversible
2.Operations which are irreversible
3.Operations which are static
4.Operations which are dynamic
Which operator is required to be overloaded as member function only?
1. _
2. _ _
3.++ (postfix version)
4.=
Which type is best suited to represent the logical values? all of the mentioned
1.integer
2.Boolean
3.character
4. all of the mentioned
Which type of data file is analogous to an audio cassette tape?
1. Random access file
2.Sequential access file
3.Binary file
4.Source code file
While overloading binary operators using member function, it requires ___ argument/s.
1.Zero
2.One
3.Two
4.Three