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

Does c have an equivalent to pascals with statement?

574


What are the __date__ and __time__ preprocessor commands?

574


If null and 0 are equivalent as null pointer constants, which should I use?

578


Why is c platform dependent?

623


The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none

713






What are pragmas and what are they good for?

577


in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above

600


C language questions for civil engineering

1245


Why C language is a procedural language?

623


How would you use the functions fseek(), freed(), fwrite() and ftell()?

705


What is a far pointer in c?

599


What is switch in c?

647


Is array name a pointer?

605


What is nested structure?

573


What is static and volatile in c?

781