Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

polymorfism c++

Arduino nerd answered on May 23, 2022 Popularity 10/10 Helpfulness 2/10

Contents


More Related Answers

  • Polymorphism
  • polymorphism
  • polymorphism c++ virtual
  • Arduino C++ polymorphism

  • polymorfism c++

    0
    Popularity 10/10 Helpfulness 2/10 Language cpp
    Tags: c++
    Link to this answer
    Share Copy Link
    Contributed on Aug 12 2022
    Arduino nerd
    0 Answers  Avg Quality 2/10

    Closely Related Answers



    2
    Popularity 10/10 Helpfulness 2/10 Language cpp
    Source: Grepper
    Tags: c++
    Link to this answer
    Share Copy Link
    Contributed on May 23 2022
    Msk SK
    0 Answers  Avg Quality 2/10

    1
    Popularity 10/10 Helpfulness 2/10 Language cpp
    Tags: c++
    Link to this answer
    Share Copy Link
    Contributed on Aug 16 2022
    Successful Shrike
    0 Answers  Avg Quality 2/10

    0
    Popularity 10/10 Helpfulness 2/10 Language cpp
    Source: Grepper
    Tags: c++
    Link to this answer
    Share Copy Link
    Contributed on May 23 2022
    naly moslih
    0 Answers  Avg Quality 2/10

    0
    Popularity 10/10 Helpfulness 2/10 Language cpp
    Tags: c++
    Link to this answer
    Share Copy Link
    Contributed on Aug 04 2022
    Envsion
    0 Answers  Avg Quality 2/10

    -1

    #include

    class Animal {

    public:

    void action() {

    std::cout << "The animal does something.\n";

    }

    };

    class Fish: public Animal {

    public:

    void action() {

    std::cout << "Fish swim.\n";

    }

    };

    class Bird: public Animal {

    public:

    void action() {

    std::cout << "Birds fly.\n";

    }

    };

    int main() {

    Animal newAnimal;

    Fish newFish;

    Bird newBird;

    newAnimal.action();

    newFish.action();

    newBird.action();

    return 0;

    }

    Popularity 9/10 Helpfulness 1/10 Language cpp
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Aug 14 2023
    Leo Fras
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.