How to avoid a class from instantiation?
Answer Posted / chandrakant
make the class Abstract it will not be instantiated
and the pure virtual function is used to avoid the base call
function to be get called if we make a function as virtual
only a derived class function will get called
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What are the operators in c++?
Write a program to add three numbers in C++ utilizing classes.
What is ios :: in in c++?
Which sort is best for the set: 1 2 3 5 4 a) Quick Sort b) Bubble Sort c) Merge Sort
What is different in C++, compare with unix?
How should a contructor handle a failure?
Differentiate between a copy constructor and an overloaded assignment operator.
Write a program to find the Fibonacci series recursively.
write a program that reads in a file and counts the number of lines, words, and characters. Your program should ask the user to input a filename. Open the file and report an error if the file does not exist or cannot be opened for some other reason. Then read in the contents of the file and count the number of lines, words, and characters in the file. Also print additional information about the file, such as the longest and shortest words, and longest and shortest lines. For simplicity, we define a word to be one or more characters ending with white space (a space, tab, carriage return, etc.). Functions for checking the types of characters can be found in the ctype.h header file, so you want to include this header file in your program. For example, the sentence below could be all that is in a file. This sentence IT 104 is taught in C++. has 32 characters, one line, and six words. The shortest line is 32 characters. The longest line is 32 characters. The shortest word is 2 characters. The longest word is 6 characters
Is it possible to pass an object of the same class in place of object reference to the copy constructor?
Is ca high or low level language?
What are vectors used for in c++?
What is enum class in c++?
What is the difference between a template and a macro?
What are the different types of comments allowed in c++?