Horje
c++ accessing parent class functinons Code Example
c++ accessing parent class functinons
class left {
public:
    void foo();
};

class right {
public:
    void foo();
};

class bottom : public left, public right {
public:
    void foo()
    {
        //base::foo();// ambiguous
        left::foo();
        right::foo();

        // and when foo() is not called for 'this':
        bottom b;
        b.left::foo();  // calls b.foo() from 'left'
        b.right::foo();  // call b.foo() from 'right'
    }
};




Cpp

Related
STL c++ Code Example STL c++ Code Example
replace a char in string c++ at a specific index Code Example replace a char in string c++ at a specific index Code Example
convert from hex to decimal c++ Code Example convert from hex to decimal c++ Code Example
C++ REMOVE element from vector Code Example C++ REMOVE element from vector Code Example
length of number c++ Code Example length of number c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10