Mega Code Archive

 
Categories / C++ Tutorial / Function
 

Functions that take no arguments

#include <iostream> using std::cout; using std::endl; void f1();  void f2( void );  int main() {    f1();     f2();     return 0;  }  void f1() {    cout << "f1 takes no arguments" << endl; } void f2( void ) {    cout << "f2 also takes no arguments" << endl; } f1 takes no arguments f2 also takes no arguments