Predict the output?
(A) Compiler Error
(C) Garbage Value
Explanation: There is compiler error: Test::Test() is private.
new makes call to the constructor. In class Test, constructor is private (note that default access is private in C++).
- C++ | new and delete | Question 1
- C++ | new and delete | Question 4
- C++ | new and delete | Question 2
- C++ | new and delete | Question 5
- "delete this" in C++
- delete and free() in C++
- C program to delete a file
- C++ | Constructors | Question 9
- C++ | Misc C++ | Question 5
- C++ | Inheritance | Question 1
- C++ | Constructors | Question 14
- C++ | Constructors | Question 15
- C++ | Destructors | Question 4
- C++ | Misc C++ | Question 7
- C++ | this pointer | Question 1