Id: funarg.tex,v 1.3 2006/01/12 06:26:45 waldmann Exp
void walk (void action (int), tree * t) { void help (tree * t) { if (NULL != t) { action (t -> node); help (t -> left); help (t -> right); } } help (t); } |
void display (tree * t) { void show (int n) { printf ("%d ", n); } walk (& show, t); } int count (tree * t) { int counter = 0; void one (int n) { counter ++; } walk (& one, t); return counter; } |
Aufgabe: geht das in C? in Pascal? in Java?