Like for example:
Is this possible?Code:
class MyClass {
public:
int Method1 (void);
int Method2 (void) : Method1 ( void );
};
Printable View
Like for example:
Is this possible?Code:
class MyClass {
public:
int Method1 (void);
int Method2 (void) : Method1 ( void );
};
No, it is not possible.
Instead, call Method2 from within Method1.
It's the same. It's not possible.
Instead, inherit from the class itself.
You should not inherit specific methods; it's usually an indication of poor design.
You should start dividing your concept into objects. Not methods or functions, because they are part of the objects.
Then if something is related to another class somehow, like say a cat to animal, then the cat class can inherit from the animal class and thus get access to all of its data and functions (although only protected/public).
For references, see cprogramming tutorials or get a good book. Plenty of suggestions in the book thread. That's all the advice I can give.