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;
}
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / kapil
There are 3 errors mainly
first header files are not included
second no semicolon at the end of class
third constructor of class cannot be private
if all these three errors are removed the output will be
constructor base
constructor derived
destructor base
| Is This Answer Correct ? | 1 Yes | 0 No |
Write a program that his output 1 12 123
What is the use of pointers in C?
0 Answers Impetus, Motorola, Tavant Technologies, Virtusa,
How main function is called in c?
what is the need for main function in c?
How can I find out if there are characters available for reading?
Can the curly brackets { } be used to enclose a single line of code?
Explain what are binary trees?
dennis ritchie invented C language in AT&T bell laboratory what is the extension of AT&T?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
Between macros and functions,which is better to use and why?
Are enumerations really portable?
prototype of sine function.