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.
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 |
to remove the repeated numbers from the given . i.e.., if the input is 12233 output should of 123
What is the correct syntax for inheritance? 1) class aclass : public superclass 2) class aclass inherit superclass 3) class aclass <-superclass
Difference between over loading and over ridding?
12 Answers CTS, Patni, Softvision Solution,
When is it necessary to use member-wise initialization list in C++?
what is the realstic modeling?
what is the basic concept of inheritance?
What is the difference between abstraction and polymorphism?
What exactly is polymorphism?
What is pure oop?
What is the difference between C++ and java?
Why is there no multiple inheritance?
#include <iostream> using namespace std; int main() { int a = 3; int c[5][5]; for (int x=0;x<5;x++) { for (int y=0;y<5;y++) { c[x][y] = x*y; } } cout << c[a][2]; }