Наследование
// Programming 1. Sample at 2017-05-18-14-06.31
#include <stdio.h>
 
 
class Person 
{
 
public:
  char m_name [20];
  int  m_age;
 
  void print() 
  {
    printf("%p name=%s, age = %d size=%lu \n",
      this, m_name,m_age,sizeof(*this));
  }
 
  Person() 
  {
    m_name[0]='\0';
    m_age = 0;
  }
};
 
class Teenager : public Person
{
  int m_bandsLiked;
public:
  void print() 
  {
    printf("%p name=%s, age = %d size=%lu %d \n",
      this,m_name,m_age,sizeof(*this), m_bandsLiked);
  }
 
};
 
 
 
int main(/*int c, char **v */)
{
  Teenager t;
  Person p;
//  p.print();
  p.Teenager::print();
  t.Person::print();
  t.Teenager::print();
 
  printf("%lu %lu\n",sizeof(p), sizeof(t));
 
  return 0;
}