#include class LogEntry //: public Singleton { public: LogEntry() ; friend ostream& operator<<(ostream& out, const LogEntry& msg) ; protected: static char s[100]; }; /* */ char LogEntry::s[100] = ""; ostream& operator<<(ostream& out, const LogEntry& msg) { return out << msg.s; } LogEntry::LogEntry() { cout << "Please enter log remark for this run:\n "; cin >> s; } /* */ main() { // ... code LogEntry a; // entry is established // ... code LogEntry b; // a no-op // ... code cout << a << endl; // entry is output cout << b << endl; // same entry is output }