C++ Programming Questions Answers - Chapter 1

  • 36. How to define a destructor

    1. X~() {}
    2. X() {}~
    3. X() ~{}
    4. ~X() {}
    Answer :

    Option D

  • 37. What is getline() in c++

    1. getline() extract the delimeter newline character from the input stream
    2. getline() does not extract the delimeter newline character from the input stream
    3. None of above
    Answer :

    Option A

  • 38. Meaning of deed copy is

    1. A deep copy creates a copy of the dynamically allocated objects too
    2. A deep copy just copies the values of the data as they are
    3. A deep copy creates a copy of the statically allocated objects too
    4. Both A and C
    Answer :

    Option A

  • 39. \r is used for

    1. carriage return
    2. new line
    3. end of the line
    4. vertical tab
    Answer :

    Option A

  • 40. Which type of variables can be referred from anywhere in the c++ code

    1. All variables
    2. Local variables
    3. Universal variables
    4. Global variables
    Answer :

    Option D

  • 41. What is inheritance

    1. Inheritance allows one class to reuse the state and behavior of another class.
    2. It deals with dangling pointers
    3. It deals with void pointers
    4. It is type of class declaration
    Answer :

    Option A

  • 42. How we mark the end of c++ statement

    1. ;
    2. :
    3. >>
    4. <<
    Answer :

    Option A

Please Like Us