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
What are two dimensional arrays alternatively called as?
explain what are actual arguments?
What is keyword in c?
What is the use of f in c?
What is FIFO?
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
What are the 32 keywords in c?
What is structure in c explain with example?
Explain the properties of union. What is the size of a union variable
develop algorithms to add polynomials (i) in one variable
Can you apply link and association interchangeably?
Explain a file operation in C with an example.
Write a code to generate divisors of an integer?
What are the advantages of using linked list for tree construction?
What is define directive?