Latest Answer: virtual destructor become meaningful when ur deleting an object of derived class associated with the pointer of base class. For ex. if A is base and B is derived and if we write expr. A *pa = new B and delete pa, we observe that destructor of ...
Can we call constructor of superclass directly without using super()method in subclass? if yes,explain,if no,why?
Latest Answer: With pointers you can do pointer arithmatic like increment or decrement the pointer.You cant do that with reference. ...
If we create a array of structures(structure must contain string field) we cannot store the data ny getting input from keyboard.Why?
What is the difference between function pointer and pointer to function?why we use static variable as a global instead of defining it a local?
Latest Answer: pointer to constant: If a pointer is pointing to constant it is called as pointer to constant.In this case we cannot change the content of constant.eg : const int n=5; int *p=&n;in this case we cannot change the value of n.constant pointer: ...
If I am declaring a private member in abstract class, although it will not be accessible in derived classes and can not be accessible by instantiating the abstract class. Then what is the optimal use of declaring private member in an abstract class.
Latest Answer: A friend function can access all private protected and public data of a class. A class has to declare a function or another class as a friend. Also the friendship is one way. Class A is friend of class B does not mean that class B is friend of class A. ...
Latest Answer: /*without virtaul*/#include #includeusing namespace std;class Base{ public: void fun() ...
Latest Answer: OOPs is closer to real life representation of the objects which we want to program.Hierarchical relationships can be represented using inheriatnce. Data can be divided as public and private -- also we can provide interface for entering and validating ...
View page << Previous 1 2 3 4 [5] 6 7 8 9 10 Next >>

Go Top