Sign in

gwj / po_oopc · Files

GitLab

  • Go to dashboard
  • Project
  • Activity
  • Files
  • Commits
  • Network
  • Graphs
  • po_oopc
  • examples10
  • 02-overload
  • overload.cpp
  • Reformatted code
    c0b14c54
    Grzegorz Jabłoński authored
    2022-09-16 14:36:36 +0200  
    Browse Code »
overload.cpp 304 Bytes
Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#include <string>
using namespace std;

class base {
  public:
    void f(int*){};
};

class derived : public base {
  public:
    void f(const string&){};
    using base::f;
};

int main()
{
    base a;
    derived b;
    string c;
    int* d = NULL;
    a.f(d);
    b.f(c);
    b.f(d);
    return 0;
}