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
Does c have an equivalent to pascals with statement?
What are the __date__ and __time__ preprocessor commands?
If null and 0 are equivalent as null pointer constants, which should I use?
Why is c platform dependent?
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
What are pragmas and what are they good for?
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
C language questions for civil engineering
Why C language is a procedural language?
How would you use the functions fseek(), freed(), fwrite() and ftell()?
What is a far pointer in c?
What is switch in c?
Is array name a pointer?
What is nested structure?
What is static and volatile in c?