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

28
2



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/

28 COMMENTS

  1. 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 ✌

  2. sir ,
    If it is hierarical inheritance then we have to create the object for CAT only. . . . .
    but u created the objects for evry fn.

  3. 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.

  4. About the explanation before the coding. Can we access the function while creating object from the Base class and not the Derived class?

  5. Very good explanation, first time learning this and i was able to grasp this topic instantly. Thank you for your amazing videos. 😁👍

  6. did you say "shapes" or "Sheeps" thanks for the work but i didnt understand the diagrams properly
    thanks aloot

  7. 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 🙂

  8. 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

  9. 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?

  10. Dude I have a doubt what is the use of scope operator ,which we write after the function signature like void abc::cde(). ?

  11. 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

LEAVE A REPLY

Please enter your comment!
Please enter your name here