/******************************************************************************/ /* */ /* FILE: JUNE.CPP */ /* */ /* Hello world implemented with an io manipulator */ /* ============================================== */ /* */ /* Compiled and tested with Visual C++ V6.0 */ /* */ /* V1.00 30-JUN-2000 P. Tellenbach http://www.heimetli.ch/ */ /* */ /******************************************************************************/ #include <iostream> using namespace std ; ostream& HelloWorld( ostream& os ) { return( os << "Hello world !" ) ; } int main() { return (cout << HelloWorld << endl).good() ; }
Update 16. June 2020
This program still compiles and runs without any changes.
Update 30. June 2025
The program needed no change, but I corrected the return value.
/******************************************************************************/ /* */ /* FILE: JUNE.CPP */ /* */ /* Hello world implemented with an io manipulator */ /* ============================================== */ /* */ /* Compiled and tested with Visual C++ V6.0 */ /* */ /* V1.00 30-JUN-2000 P. Tellenbach http://www.heimetli.ch/ */ /* */ /* Compiled and tested with g++ V11.2.0 */ /* */ /* V1.10 30-JUN-2025 P. Tellenbach https://www.heimetli.ch */ /* */ /******************************************************************************/ #include <iostream> using namespace std ; ostream& HelloWorld( ostream& os ) { return( os << "Hello world !" ) ; } int main() { return !(cout << HelloWorld << endl).good() ; }