To avoid ambiguity, the indirect base class is made ,virtual base class, to define base class as virtual. When we define virtual base class, compiler take care that only one copy of that class inherited, regardless of how many inherited path exist between the virtual base class and derived class.
If a statement within the body of a function calls the same function, the function is called recursive function. Actually, recursion is a process by which a function calls itself repeatedly until some specified condition has been satisfied. This process is used for repetitive computations in which each action is stated in term of previous result. Many iterative or repetitive problems can be written in this form. To solve a problem using recursive method, two conditions must be satisfied. They are: 1) Problem could be written or defined in term of its previous result. 2) Problem statement must include a stopping condition. /* An example of recursive function to calculate factorial of a number.*/ #include<stdio.h> #include<conio.h...
Comments
Post a Comment