C++ Programming Questions Answers - Chapter 1
-
36. How to define a destructor
- X~() {}
- X() {}~
- X() ~{}
- ~X() {}
Answer :
Option D
-
37. What is getline() in c++
- getline() extract the delimeter newline character from the input stream
- getline() does not extract the delimeter newline character from the input stream
- None of above
Answer :
Option A
-
38. Meaning of deed copy is
- A deep copy creates a copy of the dynamically allocated objects too
- A deep copy just copies the values of the data as they are
- A deep copy creates a copy of the statically allocated objects too
- Both A and C
Answer :
Option A
-
39. \r is used for
- carriage return
- new line
- end of the line
- vertical tab
Answer :
Option A
-
40. Which type of variables can be referred from anywhere in the c++ code
- All variables
- Local variables
- Universal variables
- Global variables
Answer :
Option D
-
41. What is inheritance
- Inheritance allows one class to reuse the state and behavior of another class.
- It deals with dangling pointers
- It deals with void pointers
- It is type of class declaration
Answer :
Option A
-
42. How we mark the end of c++ statement
- ;
- :
- >>
- <<
Answer :
Option A