Do we have private destructors?

Answer Posted / guest

RE: #1

You can have private constructors. It's pretty common
practice when you create a class which you want to never be
constructed with "new" from outside the class (for example,
if you have a static factory member of the class).

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does class accomplish data hiding in c++?

662


Which compiler does turbo c++ use?

609


Why is it necessary to use a reference in the argument to the copy constructor?

637


Write a C++ Program to check whether a number is prime number or not?

638


Explain the benefits of proper inheritance.

641






What is lambda expression c++?

579


Difference between an inspector and a mutator

777


What is searching?

659


How the programmer of a class should decide whether to declare member function or a friend function?

686


What is a .lib file in c++?

573


What are the advantages of c++?

596


what you know about c++?

666


What is c++ hash?

624


Which c++ operator cannot overload?

554


What is the default width for ouputting a long integer using the insertion operator?

693