Sail E0 Webinar

MCQs

Total Questions : 76 | Page 4 of 8 pages
Question 31.

The new operator


  1.    returns a pointer to the variable
  2.    creates a variable called new
  3.    obtains memory for a new variable
  4.    tells how much memory is available
 Discuss Question
Answer: Option C. -> obtains memory for a new variable



Question 32.

A library function exit() causes an exit from


  1.    the loop in which it occurs
  2.    the block in which it occurs
  3.    the function in which it occurs
  4.    the program in which it occurs
 Discuss Question
Answer: Option D. -> the program in which it occurs



Question 33.

The actual source code for implementing a template function is created when


  1.    The declaration of function appears.
  2.    The function is invoked.
  3.    The definition of the function appears.
  4.    None of the above.
 Discuss Question
Answer: Option B. -> The function is invoked.


Question 34.

Overloading the function operator


  1.    requires a class with an overloaded operator.
  2.    requires a class with an overloaded [ ] operator.
  3.    allows you to create objects that act syntactically like functions.
  4.    usually make use of a constructor that takes arguments.
 Discuss Question
Answer: Option A. -> requires a class with an overloaded operator.


Question 35.

The statement f1.write((char*)&obj1, sizeof(obj1));


  1.    writes the member function of obj1 to f1.
  2.    Writes the data in obj1 to f1.
  3.    Writes the member function and the data of obj1 to f1.
  4.    Writes the address of obj1 to f1.
 Discuss Question
Answer: Option B. -> Writes the data in obj1 to f1.



Question 36.

The keyword friend does not appear in


  1.    the class allowing access to another class.
  2.    the class desiring access to another class.
  3.    the private section of a class.
  4.    the public section of a class.
 Discuss Question
Answer: Option C. -> the private section of a class.



Question 37.

To access the public function fbase() in the base class, a statement in a derived class function fder() uses the statement.fbase();


  1.    fbase();
  2.    fder();
  3.    base::fbase();
  4.    der::fder();
 Discuss Question
Answer: Option A. -> fbase();


Question 38.

Which of the following expressions is illegal?


  1.    (10 6).
  2.    (false && true)
  3.    bool (x) = (bool)10;
  4.    float y = 12.67;
 Discuss Question
Answer: Option C. -> bool (x) = (bool)10;


Question 39.

RunTime Polymorphism is achieved by ______


  1.    friend function
  2.    virtual function
  3.    operator overloading
  4.    function overloading
 Discuss Question
Answer: Option B. -> virtual function



Question 40.

To convert from a user defined class to a basic type, you would most likely use.


  1.    A built-in conversion function.
  2.    A one-argument constructor
  3.    A conversion function that’s a member of the class.
  4.    An overloaded ‘=‘ operator
 Discuss Question
Answer: Option C. -> A conversion function that’s a member of the class.


Latest Videos

Latest Test Papers