what is virtual constroctor ? give an exam for it?-(parimal
dhimmar)

Answer Posted / john

virtual constructor is not possible.
This is because v-table is created only after the
constructor is called.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What output does the following code generate? Why? What output does it generate if you make A::Foo() a pure virtual function? class A { A() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; class B : public A { B() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; int main(int, char**) { A objectA; B objectB; return 0; }

644


write a program to convert temperature from fa height into celcius and vise versa,use modular programming

2443


How to Split Strings with Regex in Managed C++ Applications?

3133


Write a simple encryption program using string function which apply the substitution method.

5540


i don't know about working of nested for loop can any one help me

1794






write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used

4310


solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)

2937


Question 1: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date. *This Should Be Done IN C++

554


Given a table of the form: Product Sold on A 1/1/1980 B 1/1/1980 C 1/1/1980 A 1/1/1980 B 1/1/1980 C 2/1/1980 A 2/1/1980 There are 30 products and 10,000 records of such type. Also the month period during which sales happened is given to u. Write the program to display the result as: Product Month No. of copies A January 12 A February 15 A March 27 B January 54 B February 15 B March 10 C January 37

2200


write a program that reverses the input number of n.Formulate an equation to come up with the answer.

7044


create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file

2224


Ask the user to input three positive integers M, N and q. Make the 2 dimensional array of integers with size MxN, where all the elements of I (I = 1,…,M) line will be members of geometrical progression with first element equal to the number of line (I) and denominator q.

3397


Code for Method of Handling Factorials of Any Size?

2008


how to diplay a external image of output on winxp by using c & c++,

2938


Write a program that print in screen a tree with its height taken from user by entering number of 4 digits and find the odd numbers then calculate the sum of odd numbers so he get the height of tree?

2915