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 / pooja sonawane

error.
because, there is no header file.
and no ";" is given after the end of classes.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

1187


What is structure and union in c?

827


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

2035


write a c program for swapping two strings using pointer

2331


For what purpose null pointer used?

818


What is the difference between fread buffer() and fwrite buffer()?

911


int far *near * p; means

3315


Tell me is null always defined as 0(zero)?

847


What is typeof in c?

768


What are structural members?

791


What is sorting in c plus plus?

752


Can you please compare array with pointer?

839


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

861


Why is extern used in c?

838


Where are the auto variables stored?

866