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 / anvesh

there is no include file iostream for cout
immproper ending for classes ';'

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I read/write structures from/to data files?

544


Explain what are its uses in c programming?

590


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)

1623


How many header files are in c?

547


How do I round numbers?

595






What is the difference between struct and typedef struct in c?

650


Do you have any idea how to compare array with pointer in c?

598


a program that can input number of records and can view it again the record

1476


How can I ensure that integer arithmetic doesnt overflow?

604


Can you add pointers together? Why would you?

637


Can i use “int” data type to store the value 32768? Why?

752


Is return a keyword in c?

594


how many key words availabel in c a) 28 b) 31 c) 32

631


Do pointers take up memory?

650


What is c method?

531