Created
October 12, 2012 19:28
-
-
Save juanfal/3881006 to your computer and use it in GitHub Desktop.
funny example of a chain of calls to subprograms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// functioncalls.cpp | |
// juanfc 2012-06-24 | |
// funny example of a chain of calls to subprograms | |
#include <iostream> | |
using namespace std; | |
// Prototypes | |
void a(); | |
void b(); | |
void c(); | |
void d(); | |
void e(); | |
void f(); | |
int main() | |
{ | |
a(); | |
f(); f(); f(); | |
return 0; | |
} | |
void a() { cout << "Subprograms can"; b(); } | |
void b() { cout << " be called"; c(); } | |
void c() { cout << " from "; d(); } | |
void d() { cout << " anywhere in"; e(); } | |
void e() { cout << " your code."; f(); } | |
void f() { cout << " And can be repeated!" << endl;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment