How to avoid a class from instantiation?

Answer Posted / rsn

Yes, I agree with Ravi. Classes can be prevented from
instantiating and also from getting inherited using provate
constructors. The initialisation can be done using member
functions in which case it is called "clone" functions(I
hope so, Pls correct me if i'm wrong!).

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a loop? What are different types of loops in c++?

595


What is c++ w3school?

636


Write a program in c++ to print the numbers from n to n2 except 5 and its multiples

2041


Is dev c++ free?

616


What is fixed in c++?

588






A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a saleperson who sells $5000 worth of merchandise in a week receives $200 plus 9 percent of $5000, or a total of $650. You have been supplied with a list of items sold by each salesperson. The values of these items are as follows: Item Value A 239.99 B 129.75 C 99.95 D 350.89 Write a program that inputs one salesperson's items sold in a week (how many of item A? of item B? etc.) and calculates and displays that salesperson's earnings for that week.

3415


What is flag in computer?

609


What is conditions when using boolean operators?

607


What is a template in c++?

637


What are guid?

691


what is COPY CONSTRUCTOR and what is it used for?

626


What is a storage class used in c++?

618


What is the best c++ ide?

606


Where can I run c++ program?

605


What is operators in c++?

568