// Static Member Constant #include class Person { private: char name[20]; int age; // 4 bytes double height; // 8 bytes public: static const int LIFEEXPECTANCY = 80; // 1995 C++ standard // enum { LIFEEXPECTANCY = 80 }; // for old compilers. See page 725 friend void operator >> (istream& ins, Person& target) { cout << "Enter name (max. 20 char): "; ins >> target.name; cout << "Enter age: "; ins >> target.age; cout << "Enter height: "; ins >> target.height; } }; void main() { Person p1; cin >> p1; cout << p1.LIFEEXPECTANCY << endl; cout << Person::LIFEEXPECTANCY; }