Trees |
|
CompilationAn easy way to compile and run:
Copy all `.c' and `.h' files into a clean Unix/Linux directory (folder).
Procedure Formal ParametersSome of the procedures in this directory
have procedure formal parameters,
i.e. parameters that are themselves procedures
such as void infix(Tree T, void process(TreeElementType)) /* NB. process is a procedure formal parameter. */ { if( T != NULL ) { infix( T->left, process ); process(T->elt); infix( T->right, process ); } }/*infix*/ /* Infix Tree Traversal. */
void PrintElt(TreeElementType e) { printf("%s ", e); } ... infix(someTree, PrintElt); /* call infix */ /* PrintElt is the procedure actual parameter */
Procedure formal parameters are particularly useful in the parser. |
|
↑ © L. Allison, www.allisons.org/ll/ (or as otherwise indicated). Created with "vi (Linux)", charset=iso-8859-1, fetched Sunday, 03-Dec-2023 07:53:58 UTC. Free: Linux, Ubuntu operating-sys, OpenOffice office-suite, The GIMP ~photoshop, Firefox web-browser, FlashBlock flash on/off. |