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
Where does the name "C" come from, anyway?
Differentiate between new and malloc(), delete and free() ?
What is typedef?
Is c dynamically typed?
write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.
What is difference between array and structure in c?
How does #define work?
Which header file is essential for using strcmp function?
Explain the difference between strcpy() and memcpy() function?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
How can I convert a number to a string?
Where define directive used?
How will you print TATA alone from TATA POWER using string copy and concate commands in C?
How can I find out if there are characters available for reading?
What is volatile c?