Function Overriding in C++ | Inheritance | OOP in C++ programming



In this video we will study and understand the concept of Function Overriding and compare with with Function Overloading and how they both are different from each other.
We will compare them theoretically and then we will also see a c++ program example of function overriding.

Function Overloading – Function overloading is a feature in C++ where two or more functions can have the same name but different parameters.
Function overloading can be considered as an example of polymorphism feature in C++

Function Overriding – If derived class defines same function as defined in its base class, it is known as function overriding in C++
If you create an object of the derived class and call the member function which exists in both classes (base and derived), the member function of the derived class is invoked and the function of the base class is ignored.
It enables you to provide specific implementation of the function which is already provided by its base class.

Function Overriding in C++ Theory Article –

Download Dev C++ IDE :
Download C++ Android App :

Simple Snippets Official Website –

Simple Snippets on Facebook-

Simple Snippets on Instagram-

Simple Snippets Google Plus Page-

Simple Snippets email ID-
simplesnippetsinfo@gmail.com

For Classroom Coaching in Mumbai for Programming & other IT/CS Subjects Checkout UpSkill Infotech –

UpSkill is an Ed-Tech Company / Coaching Centre for Information Technology / Computer Science oriented courses and offer coacing for various Degree courses like BSc.IT, BSc.CS, BCA, MSc.IT, MSc.CS, MCA etc.

Contact via email /call / FB /Whatsapp for more info
email – upskillinfotech@gmail.com

We also Provide Certification courses like –
Android Development
Web Development
Java Developer Course
.NET Developer Course

Check us out on Social media platforms like Facebook, Instagram, Google etc
Facebook page –
Insta page –
Google Maps –

Nguồn: https://chototdayroi.com

Xem thêm bài viết khác: https://chototdayroi.com/cong-nghe/


Article Categories:
Công Nghệ

Comments

  • Hey Guys, if you want more such tech educational videos on this channel then please support me by subscribing to this channel & also share it with your friends as it helps me create more content just for you ✌

    Simple Snippets June 15, 2020 4:19 pm Reply
  • sir ,
    If it is hierarical inheritance then we have to create the object for CAT only. . . . .
    but u created the objects for evry fn.

    Damarla Om jaya Sankar June 15, 2020 4:19 pm Reply
  • Good tutorial
    But stop saying there is another tutorial on this topic another tutorial on this topic another tutorial on this topic.
    Can find that as this one also .
    Irritating. plz
    thnx.

    Vipul Sontakke June 15, 2020 4:19 pm Reply
  • Good tutorial
    But stop dropping cards.

    Vipul Sontakke June 15, 2020 4:19 pm Reply
  • About the explanation before the coding. Can we access the function while creating object from the Base class and not the Derived class?

    Ivan Kocevski June 15, 2020 4:19 pm Reply
  • Very good explanation, first time learning this and i was able to grasp this topic instantly. Thank you for your amazing videos. 😁👍

    Hunter zone June 15, 2020 4:19 pm Reply
  • but then when do we use virtual functions??

    Anshika Anshika June 15, 2020 4:19 pm Reply
  • what is the general meaning of scope resolution func i.e. double colon??

    dftba June 15, 2020 4:19 pm Reply
  • Nice explanation 🔥

    Sidhartha Maurya June 15, 2020 4:19 pm Reply
  • Function overriding small error semicolon while overriding getdata() in derived class

    PUCB G June 15, 2020 4:19 pm Reply
  • did you say "shapes" or "Sheeps" thanks for the work but i didnt understand the diagrams properly
    thanks aloot

    Musinguzi Marvin Joseph June 15, 2020 4:19 pm Reply
  • The example should have been the one with figures and areas, not the concept already saw on diagrams before! Just an advice, great videos! Thanks 🙂

    i'Pare - My Singing Monsters June 15, 2020 4:19 pm Reply
  • DerivedClass obj = DerivedClass();
    BaseClass obj = DerivedClass();
    wats this can you explain and how it is suppose to transfer the control to the base function
    i read it somewhere else

    Aditya Verma June 15, 2020 4:19 pm Reply
  • I am using codeBlocks. There it shows
    ||=== Build file: "no target" in "no project" (compiler: unknown) ===|

    C:UsersUSERDocuments39.cpp||In function 'int main()':|

    C:UsersUSERDocuments39.cpp|15|error: 'void Dog::makesound()' is private|

    C:UsersUSERDocuments39.cpp|35|error: within this context|

    C:UsersUSERDocuments39.cpp|22|error: 'void Cat::makesound()' is private|

    C:UsersUSERDocuments39.cpp|39|error: within this context|

    ||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

    why it is so?

    Lakhwinder Angroia June 15, 2020 4:19 pm Reply
  • You are awesome sirr…..🙏🙏🙏

    Zucky Tech June 15, 2020 4:19 pm Reply
  • great teacher .love the way you do it..
    can you just add some more practical examples from dev cpp.

    AASIM_ _OFFICIAL June 15, 2020 4:19 pm Reply
  • The fuck is this x10 speed? I cant understand shit.

    Elyrb June 15, 2020 4:19 pm Reply
  • Dude I have a doubt what is the use of scope operator ,which we write after the function signature like void abc::cde(). ?

    Harish R June 15, 2020 4:19 pm Reply
  • Create more example!😊

    Niraj Jain June 15, 2020 4:19 pm Reply
  • Function overriding to achieve why virtual function you have not used. You have missed

    DEEPAK PAWATE June 15, 2020 4:19 pm Reply
  • When he said "shapes" I thought he said "sheeps" lmao

    Water Melon June 15, 2020 4:19 pm Reply
  • Awesome explaination…..plz guide me how i can improve my vocabulary

    Ashish Kushwaha June 15, 2020 4:19 pm Reply
  • Where are u from

    MEMES 4 YOU June 15, 2020 4:19 pm Reply
  • Hi

    MEMES 4 YOU June 15, 2020 4:19 pm Reply
  • Good English

    MEMES 4 YOU June 15, 2020 4:19 pm Reply
  • sir I have watched both videos
    sir, I think overriding is used in inheritance and overloading is used in simple class
    Am I right sir ?
    i am very sorry to have written the previous comment

    Din Muhammad Umar June 15, 2020 4:19 pm Reply
  • Thanks man

    Subrata Mitra June 15, 2020 4:19 pm Reply
  • I thought function overriding was only possible with virtual functions.

    Peterolen June 15, 2020 4:19 pm Reply

Leave a Comment

Your email address will not be published. Required fields are marked *