/* testfunc01.cpp CIS 150 2008-06-10 David Klick This program demonstrates how to create and call a very simple function. */ #include using std::cin; using std::cout; void greeting(); // function prototype void cont(); int main(int argc, char* argv[]) { greeting(); // call function cont(); return 0; } /* void greeting(); Arguments: none Returns: nothing This function displays the greeting "Hello, world!" and then goes to a new line. */ void greeting() { cout << "Hello, world!\n"; return; // optional since no value is returned } /* void cont(); Arguments: none Returns: nothing Clears input buffer and pauses waiting for user to press Enter. */ void cont() { if (cin.rdbuf()->sungetc() != -1 && cin.get() != '\n') cin.ignore(80,'\n'); cout << "Press enter to continue..."; cin.get(); }