1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <stdio.h> #include "programmer.h" _programmer::_programmer(const char *name) : _person(name) { lang_skill = 0; } void _programmer::learn(int lang) { lang_skill |= lang; } void _programmer::show() { _person::show(); if (lang_skill & C) printf("I master C language.\n"); if (lang_skill & JAVA) printf("I master Java language.\n"); }