: public superclass_name.private in foo. The program will compile and run if we change private to protected in foo or if foo provides a function to access counter, which would be called in bar.bar::bar(bar& a_bar)
{
name = new char[strlen(name) + 1];
strcpy(name, a_bar.name);
salary = a_bar.salary;
}: public superclass-name. C++ implements the other relationships with variables.