what is out put of the following code?
#include
class Base
{
Base()
{
cout<<"constructor base";
}
~Base()
{
cout<<"destructor base";
}
}
class Derived:public Base
{
Derived()
{
cout<<"constructor derived";
}
~Derived()
{
cout<<"destructor derived";
}
}
void main()
{
Base *var=new Derived();
delete var;
}

Answer Posted / anvesh

there is no include file iostream for cout
immproper ending for classes ';'

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an array in c?

597


Can we access the array using a pointer in c language?

563


Why we not create function inside function.

1749


The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration

634


What is an auto keyword in c?

641






Are comments included during the compilation stage and placed in the EXE file as well?

672


What is function pointer c?

586


What is preprocessor with example?

587


What is the difference between NULL and NUL?

728


When should the volatile modifier be used?

687


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

632


How pointers are declared?

561


Why is struct padding needed?

631


Define Spanning-Tree Protocol (STP)

643


What is the g value paradox?

645