1.explicit call for destructor
2.calling function inside a constructor.
3.base *b-new derived
delete b;
4.delete p what it will delete.
5.size of base class and derived class int i,in base class
and int j in derived.
6.int i-20
int main()
{

int i =5;
printf("%d".::i);

{

int i =10;
printf("%d".::i);

}
}
7.object slicing
8.new
9.function overloading(return type).
10.class base()
{

virtuval fun()
{
-----
}
}

class derivied:public base()
{
fun()
{
-----
}
}
int main()
{
derived d;

}

11.how static function will call in C++?

12.default structures are in C++?
13.constructors should be in public .
14.virtuval constructor not exist.
15.multilevel inhritence. destructor order.



1.explicit call for destructor 2.calling function inside a constructor. 3.base *b-new derived del..

Answer / achal ubbott

OK! this is a set of questions. Let me see how far can I go.

1. destructor of a class can be called explicitly as
follows using the object of the class.

sample * p = new sample(/*some arguments*/);
p->~sample(); // explicit call;

3. correct order of destructor call is ~derived() and then
~base().
in case you haven't declared the destructor of base as
virtual then delete base; would cause problems.

cheers

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More OOPS Interview Questions

what is the new version of oops

0 Answers   Ignou,


What are constructors in oop?

0 Answers  


What does sksksk mean in text slang?

0 Answers  


What do you mean by public, private, protected and friendly?

3 Answers   CA,


how to find no of instances of an object in .NET?

1 Answers   Infosys,






What is a function in oop?

0 Answers  


Have you ever interfaced with a database?

2 Answers   IBM,


Why do we use polymorphism?

0 Answers  


write a c++ program to find maximum of two numbers using inline functions.

3 Answers   IBM,


What is the benefit of oop?

0 Answers  


should we use linear search or binary search if elements are placed in random order or mixed?in both cases? i need a little bit detail ans?thnks

2 Answers  


What is the example of polymorphism?

0 Answers  


Categories