inheritance in C++

Public, protected, and private inheritance have the following features:
* public inheritance makes public members of the base class public in the derived class, and the protected members of the base class remain protected in the derived class.
* protected inheritance makes the public and protected members of the base class protected in the derived class.
* private inheritance makes the public and protected members of the base class private in the derived class. Private inheritance is a syntactic variant of composition (AKA aggregation and/or has-a).
* In the absence of an access-specifier for a base class, public is assumed when the derived class is defined as struct and private is assumed when the class is defined as class.

The private members in the base class cannot be directly accessed in the derived class, while protected members can be directly accessed. 
```
#include <iostream>
using namespace std;

class Food {
public:
  void taste() { 
    cout << "The taste of every food is different.\n";
  }
};

class Chips: public Food {
public:
  void taste() {
    cout << "The taste of chips is salty.\n";   
  }
};

int main() {
    Chips chips;
    chips.taste();
}
```