Placement papers on C++ - Set 5
1. Declaration of a pointer reserves memory space
for the object.
for the pointer.
both for the object and the pointer
none of these.View Answer / Hide Answer
2. Consider the following statements
ptr = hello;
cout << *ptr;
What will be printed?
it is a syntax error
last letterView Answer / Hide Answer
3. In which case is it mandatory to provide a destructor in a class?
Almost in every class
Class for which two or more than two objects will be created
Class for which copy constructor is defined
Class whose objects will be created dynamicallyView Answer / Hide Answer
ANSWER: Class whose objects will be created dynamically
4. The members of a class, by default, are
mandatory to specifyView Answer / Hide Answer
5. What is the output of the following code
for (int index=0; index < 3; index++)
cout << symbol [index];
a b c
abcView Answer / Hide Answer
6. The process of building new classes from existing one is called ______
CascadingView Answer / Hide Answer
7. To perform stream I/O with disk files in C++, you should
open and close files as in procedural languages.
use classes derived from ios.
use C language library functions to read and write data.
include the IOSTREAM.H header file.View Answer / Hide Answer
ANSWER: use classes derived from ios.
8. RunTime Polymorphism is achieved by ______
function overloadingView Answer / Hide Answer
9. In C++, dynamic memory allocation is accomplished with the operator ____
deleteView Answer / Hide Answer
10. Overloading the function operator
requires a class with an overloaded operator.
requires a class with an overloaded [ ] operator.
allows you to create objects that act syntactically like functions.
usually make use of a constructor that takes arguments.View Answer / Hide Answer
ANSWER: requires a class with an overloaded operator.