how to access base class member function
-
Hi to all Please look at the following code:
class base
{
public:
void show_base()
{
cout<<"executing base"<In the above my problem is "I want to access a base class member function.i.e when i called show\_derived(), it needs first calls show\_base() and then show\_derived() remaining code should execute. Is it possible to call like this. Or please show me any other possibilities
Thanks in advance......................
To invent something, you need a mountain of junk in your mind.
---------------------Thomas alva edison -
Hi to all Please look at the following code:
class base
{
public:
void show_base()
{
cout<<"executing base"<In the above my problem is "I want to access a base class member function.i.e when i called show\_derived(), it needs first calls show\_base() and then show\_derived() remaining code should execute. Is it possible to call like this. Or please show me any other possibilities
Thanks in advance......................
To invent something, you need a mountain of junk in your mind.
---------------------Thomas alva edisonsampath-padamatinti wrote:
cout<<"code is added at derived class":
Excluding a minor syntax error in the above line (colon instead of semicolon at the end of the statement), your code,as it stands, produces exactly the output you require. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Hi to all Please look at the following code:
class base
{
public:
void show_base()
{
cout<<"executing base"<In the above my problem is "I want to access a base class member function.i.e when i called show\_derived(), it needs first calls show\_base() and then show\_derived() remaining code should execute. Is it possible to call like this. Or please show me any other possibilities
Thanks in advance......................
To invent something, you need a mountain of junk in your mind.
---------------------Thomas alva edisonHello, The code is giving required output. What is your question? Is that something which you need different an output?
-
Hello, The code is giving required output. What is your question? Is that something which you need different an output?
Thanks for reply, sorry, I am not check my code properly. It s giving me correct answer.
To invent something, you need a mountain of junk in your mind. ---------------------Thomas alva edison