C++

Write a Program to Implement Virtual Function.

By April 8, 2016 November 9th, 2016 96 Comments

#include <iostream>
#include <conio.h>
using namespace std;
class a
{
public:
virtual void show()
{
cout << “In class a”;
}
};
class b : public a
{
public:
void show()
{
cout << “\nIn class b”;
}
};
class c : public a
{
public:
void show()
{
cout << “\nIn class c”;
}
};

main()
{
a *p, obj_a;
b obj_b;
c obj_c;
p = &obj_a;
p -> show();
p = &obj_b;
p -> show();
p = &obj_c;
p -> show();
getch();
}



96 Comments

  • Aw, this was a really nice post. In idea I want to put in writing like this moreover ?taking time and precise effort to make an excellent article?however what can I say?I procrastinate alot and certainly not appear to get something done.

  • yeezy shoes says:

    Thank you so much for providing individuals with remarkably remarkable chance to read critical reviews from this website. It really is so pleasing plus stuffed with amusement for me personally and my office mates to visit your blog nearly three times per week to study the latest secrets you will have. And lastly, I’m just certainly happy with your sensational inspiring ideas served by you. Selected 1 ideas on this page are truly the finest we have ever had.

  • I抎 have to test with you here. Which isn’t something I normally do! I take pleasure in studying a publish that will make people think. Additionally, thanks for allowing me to remark!

  • Thanks a lot for giving everyone a very splendid opportunity to read articles and blog posts from this site. It really is very fantastic and also jam-packed with a good time for me personally and my office acquaintances to visit your blog no less than 3 times in one week to study the fresh guides you have got. And of course, I am also certainly satisfied considering the fabulous hints you give. Certain 2 areas on this page are clearly the most impressive we have all had.

  • There’s noticeably a bundle to learn about this. I assume you made sure good points in features also.

  • Can I just say what a relief to find someone who truly knows what theyre speaking about on the internet. You definitely know how one can deliver a problem to mild and make it important. Extra folks need to learn this and understand this facet of the story. I cant consider youre not more widespread since you definitely have the gift.

  • I’m usually to running a blog and i really appreciate your content. The article has really peaks my interest. I am going to bookmark your site and keep checking for brand spanking new information.

  • nmd r1 says:

    This really answered my drawback, thanks!

  • You made some decent points there. I appeared on the web for the problem and found most people will go together with along with your website.

  • fitflops says:

    This actually answered my downside, thanks!

  • I just want to mention I am all new to weblog and honestly savored you’re web blog. Almost certainly I’m planning to bookmark your site . You surely come with excellent posts. Cheers for revealing your blog.

  • yeezy shoes says:

    I enjoy you because of your whole hard work on this web page. Betty enjoys conducting investigation and it’s obvious why. All of us learn all concerning the dynamic mode you offer great tips via the blog and therefore boost contribution from the others on the idea and our own daughter is now starting to learn a great deal. Take pleasure in the remaining portion of the year. You are conducting a remarkable job.

  • Can I simply say what a reduction to seek out somebody who really knows what theyre talking about on the internet. You undoubtedly know learn how to convey an issue to light and make it important. Extra folks have to read this and perceive this facet of the story. I cant believe youre not more in style because you definitely have the gift.

  • There are some fascinating closing dates on this article however I don抰 know if I see all of them middle to heart. There’s some validity but I’ll take hold opinion till I look into it further. Good article , thanks and we wish more! Added to FeedBurner as well

  • yeezy shoes says:

    An attention-grabbing dialogue is worth comment. I feel that you need to write more on this subject, it might not be a taboo subject but typically people are not enough to speak on such topics. To the next. Cheers

  • yeezy boost says:

    I and my friends were actually going through the great items from your web page then suddenly got a terrible suspicion I had not thanked the web site owner for those tips. My women were definitely totally stimulated to read all of them and already have definitely been loving those things. I appreciate you for actually being considerably helpful as well as for picking out certain smart useful guides most people are really eager to discover. Our own sincere regret for not saying thanks to earlier.

  • hermes belt says:

    very nice submit, i actually love this website, carry on it

  • I found your blog site on google and test a few of your early posts. Continue to maintain up the superb operate. I simply further up your RSS feed to my MSN Information Reader. Looking for forward to reading extra from you later on!?

  • I actually wanted to develop a note in order to express gratitude to you for some of the amazing tips and tricks you are sharing here. My extensive internet look up has at the end of the day been compensated with useful strategies to share with my best friends. I would point out that we site visitors are rather fortunate to exist in a remarkable place with many marvellous individuals with useful tips. I feel really lucky to have come across the site and look forward to tons of more amazing minutes reading here. Thanks a lot once more for all the details.

  • Whats up! I simply would like to give an enormous thumbs up for the great information you’ve right here on this post. I might be coming back to your weblog for extra soon.

  • After I originally commented I clicked the -Notify me when new feedback are added- checkbox and now every time a remark is added I get 4 emails with the identical comment. Is there any manner you may take away me from that service? Thanks!

  • There are actually a whole lot of particulars like that to take into consideration. That may be a great level to deliver up. I supply the thoughts above as basic inspiration but clearly there are questions like the one you bring up where an important thing will be working in sincere good faith. I don?t know if greatest practices have emerged round things like that, but I am sure that your job is clearly recognized as a fair game. Each boys and girls feel the impact of only a moment抯 pleasure, for the rest of their lives.

  • Technology says:

    Fantastic web site. Lots of helpful information here. I am sending it to a few friends ans also sharing in delicious. And naturally, thank you in your effort!

  • Game says:

    Thank you for any other great article. Where else may anyone get that type of information in such a perfect manner of writing? I have a presentation next week, and I’m at the look for such info.

  • Your house is valueble for me. Thanks!?

  • Business says:

    Hello there, I discovered your website by way of Google whilst searching for a related topic, your web site got here up, it looks good. I have bookmarked it in my google bookmarks.

  • I am usually to blogging and i actually admire your content. The article has really peaks my interest. I am going to bookmark your web site and preserve checking for brand spanking new information.

  • Sports says:

    I will immediately clutch your rss feed as I can’t in finding your e-mail subscription link or newsletter service. Do you have any? Please let me know in order that I could subscribe. Thanks.

  • Travel says:

    I really enjoy looking through on this web site, it has wonderful content. “The living is a species of the dead and not a very attractive one.” by Friedrich Wilhelm Nietzsche.

  • I regard something truly interesting about your website so I bookmarked .

  • Technology says:

    Keep up the superb work , I read few articles on this site and I conceive that your website is very interesting and has lots of fantastic info .

  • I just wanted to develop a brief note so as to appreciate you for the fantastic recommendations you are giving on this website. My incredibly long internet search has now been honored with reliable content to share with my friends and family. I would express that we site visitors are undoubtedly endowed to exist in a fabulous community with many special professionals with good principles. I feel rather grateful to have come across your website and look forward to some more amazing minutes reading here. Thank you again for a lot of things.

  • polo lacoste says:

    There may be noticeably a bundle to learn about this. I assume you made sure nice points in features also.

  • I have been surfing online greater than three hours these days, but I by no means found any interesting article like yours. It is lovely price sufficient for me. In my view, if all website owners and bloggers made just right content as you probably did, the net might be a lot more helpful than ever before.

  • Pets says:

    You made some good points there. I did a search on the subject matter and found most people will consent with your blog.

  • Super-Duper website! I am loving it!! Will be back later to read some more. I am taking your feeds also

  • Awsome post and right to the point. I don’t know if this is really the best place to ask but do you guys have any ideea where to employ some professional writers? Thanks 🙂

  • I simply wanted to write a note to appreciate you for the magnificent facts you are sharing at this website. My time-consuming internet research has now been honored with professional facts to write about with my companions. I ‘d assume that we visitors are very much endowed to dwell in a useful site with so many brilliant individuals with very beneficial principles. I feel somewhat blessed to have come across your web site and look forward to some more excellent minutes reading here. Thank you again for a lot of things.

  • I am not certain the place you’re getting your information, but good topic. I needs to spend a while studying much more or working out more. Thanks for great information I used to be searching for this information for my mission.

  • I truly enjoy reading on this web site , it holds excellent posts . “Words are, of course, the most powerful drug used by mankind.” by Rudyard Kipling.

  • Emery EPS says:

    Truly intriguing knowledge you have mentioned, thank you for posting.

  • Business says:

    Great beat ! I would like to apprentice while you amend your website, how can i subscribe for a blog web site? The account aided me a acceptable deal. I had been tiny bit acquainted of this your broadcast offered bright clear concept

  • Healthy Life says:

    F*ckin’ remarkable issues here. I’m very satisfied to look your post. Thank you a lot and i am having a look forward to touch you. Will you please drop me a e-mail?

  • Science says:

    I got what you intend, regards for putting up.Woh I am glad to find this website through google. “Delay is preferable to error.” by Thomas Jefferson.

  • I really enjoy looking at on this site, it has got excellent content . “One doesn’t discover new lands without consenting to lose sight of the shore for a very long time.” by Andre Gide.

  • Law & Legal says:

    whoah this weblog is magnificent i love studying your posts. Stay up the good work! You understand, a lot of persons are hunting round for this info, you can aid them greatly.

  • Home Design says:

    Great paintings! That is the type of info that are supposed to be shared across the web. Shame on Google for now not positioning this put up higher! Come on over and visit my web site . Thanks =)

  • Gardenings says:

    I genuinely enjoy reading on this internet site , it contains good blog posts. “You should pray for a sound mind in a sound body.” by Juvenal.

  • Woman says:

    Only wanna comment that you have a very nice site, I enjoy the style and design it really stands out.

  • Family says:

    I have been browsing online more than 3 hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. Personally, if all webmasters and bloggers made good content as you did, the internet will be much more useful than ever before.

  • Donate Car says:

    Hiya very nice website!! Guy .. Excellent .. Superb .. I’ll bookmark your site and take the feeds additionally…I am glad to seek out numerous helpful information right here within the submit, we need develop extra strategies on this regard, thanks for sharing.

  • Automotive says:

    I want to show thanks to you just for bailing me out of this condition. Because of browsing throughout the internet and getting concepts which were not helpful, I thought my life was well over. Being alive devoid of the approaches to the difficulties you’ve resolved by way of your guide is a crucial case, as well as those that could have negatively damaged my career if I hadn’t noticed the website. Your personal natural talent and kindness in dealing with the whole lot was priceless. I’m not sure what I would’ve done if I had not discovered such a solution like this. I can also at this point look ahead to my future. Thanks so much for your reliable and effective help. I will not think twice to endorse your blog post to any individual who needs assistance about this subject.

  • This is getting a bit more subjective, but I much prefer the Zune Marketplace. The interface is colorful, has more flair, and some cool features like ‘Mixview’ that let you quickly see related albums, songs, or other users related to what you’re listening to. Clicking on one of those will center on that item, and another set of “neighbors” will come into view, allowing you to navigate around exploring by similar artists, songs, or users. Speaking of users, the Zune “Social” is also great fun, letting you find others with shared tastes and becoming friends with them. You then can listen to a playlist created based on an amalgamation of what all your friends are listening to, which is also enjoyable. Those concerned with privacy will be relieved to know you can prevent the public from seeing your personal listening habits if you so choose.

  • It really is right occasion to put together some options for the future. I’ve looked over this document and if I can, I wish to recommend you few intriguing suggestions.

  • I merely desire to show you that I am new to online blogging and totally adored your site. Likely I am prone to save your blog post . You certainly have impressive article material. Acknowledge it for sharing with us your main website write-up

  • find more says:

    Absolutely compelling suggestions you have remarked, many thanks for putting up.

  • see this says:

    It truly is mostly not possible to find well-qualified parties on this matter, and yet you seem like you understand those things you’re preaching about! Appreciation

  • I was pretty pleased to find this great site. I wanted to thank you for ones time due to this wonderful read!! I definitely enjoyed every part of it and I have you saved to fav to check out new stuff in your web site.

  • Hullo here, just became mindful of your web page through Search engine, and realized that it is very educational. I’ll value if you decide to continue these.

  • I really wish to show you that I am new to putting up a blog and certainly liked your page. Most likely I am prone to remember your blog post . You undoubtedly have fabulous article content. Value it for discussing with us your main url page

  • about his says:

    Remarkably motivating highlights you have remarked, thank you so much for adding.

  • It is usually most suitable occasion to put together some options for the future. I’ve browsed this blog posting and if I can possibly, I desire to encourage you very few appealing instruction.

  • What i do not realize is in truth how you’re no longer actually much more smartly-preferred than you might be right now. You’re very intelligent. You realize therefore considerably in the case of this subject, produced me in my opinion believe it from a lot of numerous angles. Its like women and men aren’t fascinated except it¡¦s one thing to do with Woman gaga! Your individual stuffs outstanding. Always maintain it up!

  • I just desire to notify you that I am new to putting up a blog and extremely enjoyed your article. Most likely I am probably to save your blog post . You indeed have excellent article materials. Be Grateful For it for discussing with us your own url webpage

  • Truly stimulating specifics you’ll have mentioned, many thanks for adding.

  • Our site says:

    Remarkably beneficial highlights you have remarked, a big heads up for setting up.

  • Might be mostly unthinkable to come across well-updated parties on this subject, however , you look like you fully grasp whatever you’re posting on! With Thanks

  • Howdy there, just turned mindful of your writings through Bing, and discovered that it’s very interesting. I’ll be grateful for if you decide to continue this idea.

  • Games says:

    hi!,I really like your writing so so much! proportion we keep in touch more about your article on AOL? I require an expert in this space to resolve my problem. Maybe that is you! Looking ahead to see you.

  • Dog says:

    Nice read, I just passed this onto a friend who was doing some research on that. And he actually bought me lunch as I found it for him smile Therefore let me rephrase that: Thanks for lunch!

  • Automotive says:

    magnificent issues altogether, you just received a emblem new reader. What would you recommend about your publish that you just made a few days in the past? Any certain?

  • Very useful knowledge you’ll have said, thank you so much for putting up.

  • I intended to put you a very little note to help give many thanks the moment again just for the amazing views you have discussed on this page. It was remarkably generous with people like you to supply publicly precisely what a few individuals would have made available for an electronic book to help make some bucks for their own end, and in particular given that you could possibly have tried it in case you wanted. The tips also acted to be a fantastic way to be certain that other people have the identical passion just as my personal own to know the truth way more in regard to this issue. I think there are numerous more enjoyable situations up front for folks who see your site.

  • My Site says:

    I’m very pleased to discover this great site. I want to to thank you for ones time for this particularly wonderful read!! I definitely enjoyed every part of it and i also have you bookmarked to see new things on your site.

  • obviously like your web site but you have to take a look at the spelling on several of your posts. A number of them are rife with spelling problems and I in finding it very troublesome to tell the reality nevertheless I¡¦ll surely come back again.

  • Woman says:

    Hello there, You’ve done a great job. I will certainly digg it and personally recommend to my friends. I am sure they will be benefited from this site.

  • Business says:

    I’m still learning from you, but I’m trying to reach my goals. I absolutely liked reading everything that is written on your blog.Keep the aarticles coming. I loved it!

  • It’s right time to generate some options for the possible future. I’ve looked over this post and if I can, I desire to suggest to you you handful important assistance.

  • Business says:

    Great ¡V I should certainly pronounce, impressed with your site. I had no trouble navigating through all the tabs and related info ended up being truly simple to do to access. I recently found what I hoped for before you know it in the least. Reasonably unusual. Is likely to appreciate it for those who add forums or something, web site theme . a tones way for your client to communicate. Nice task..

  • It is actually mostly impossible to come across well-qualified americans on this niche, still, you look like you are familiar with exactly what you’re writing about! Bless You

  • It happens to be most suitable time to prepare some preparations for the long-run. I’ve scan this blog post and if I can possibly, I desire to propose you few appealing assistance.

  • visit here says:

    Greetings here, just became receptive to your website through Google, and discovered that it is quite entertaining. I will truly appreciate if you continue on such.

  • Education says:

    I wanted to post you the little bit of remark to thank you once again for your amazing techniques you’ve contributed at this time. This has been extremely open-handed of you to convey publicly all that numerous people would’ve offered as an electronic book to generate some dough for themselves, primarily since you might well have done it in case you decided. These ideas also served as a fantastic way to be sure that other individuals have a similar desire just like mine to know more and more concerning this problem. Certainly there are millions of more pleasant instances in the future for individuals that see your blog.

  • I was pretty pleased to uncover this website. I wanted to thank you for your time for this particularly wonderful read!! I definitely really liked every little bit of it and i also have you book marked to see new information in your website.

  • Technology says:

    We are a group of volunteers and starting a new scheme in our community. Your website provided us with valuable info to work on. You have done a formidable job and our whole community will be thankful to you.

  • There is obviously a bundle to realize about this. I think you made some good points in features also.

  • Fairly intriguing points you have stated, thanks for posting.

  • Business says:

    I have been exploring for a bit for any high-quality articles or blog posts on this sort of house . Exploring in Yahoo I eventually stumbled upon this website. Studying this information So i am glad to convey that I’ve a very good uncanny feeling I discovered just what I needed. I most certainly will make certain to don¡¦t disregard this site and give it a look on a continuing basis.

  • Extraordinarily useful suggestions that you have said, thank you for adding.

  • blog website says:

    I simply want to inform you you that I am new to writing a blog and pretty much cherished your report. Probably I am prone to bookmark your blog post . You simply have memorable article information. Be Grateful For it for giving out with us your current site information

  • Business says:

    You actually make it appear really easy together with your presentation however I to find this matter to be really something which I think I might by no means understand. It kind of feels too complicated and extremely vast for me. I’m looking ahead on your next submit, I¡¦ll attempt to get the dangle of it!

  • Definitely entertaining points you’ll have remarked, many thanks for writing.

  • great post, very informative. I ponder why the opposite specialists of this sector don’t notice this. You must continue your writing. I’m sure, you’ve a great readers’ base already!

  • Surprisingly interesting advice you’ll have stated, thanks for publishing.

  • I simply need to tell you that I am new to wordpress blogging and completely valued your review. Quite possibly I am prone to bookmark your blog post . You really have wonderful article materials. Like it for expressing with us your website page

Leave a Reply