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 |
main() { int i; printf("%d",i^i); }
what is ram?
How would you write qsort?
The file stdio.h, what does it contain?
What is a stream in c programming?
how to add numbers without using arithmetic operators.
In which header file is the null macro defined?
How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
#include<stdio.h> void main() { int a=5,b=6,c; int x=(a<b)+7; int y=(x==7)*9; int z=(c=x+y)*2; printf("%h %h %h",x,y,z); } What is the output? Explain it.
what is difference b/w extern & volatile variable??
Can we access RAM? How? Whats the range of access? Similarly What are other hardware we can access?
how to build a exercise findig min number of e heap with list imlemented?