This question is based on the following C++ code segment and class FUN: class…
2022
This question is based on the following C++ code segment and class FUN: class FUN { int CODE; public: FUN(); // Function1 FUN(int C); // Function2 FUN(FUN &F); // Function3 void DISP(); // Function4 ~FUN(); // Function5 }; void main() { FUN F1; ________ // BLANK
- A.
Function 1
- B.
Function 2
- C.
Function 3
- D.
Function 5
Attempted by 174 students.
Show answer & explanation
Correct answer: D
A destructor is a special member function whose name is the same as the class name but prefixed with a tilde (~). It has no parameters and no return type. In the given class, ~FUN() (Function5) is the destructor.