CS211 Lab 12
Due Thursday, December 7
There are a lot of situations where a little function is needed as a parameter to something else. For example, one solution I posted to lab 9 required a comparison function to compare integers, which is surely an easy task. Data structures like trees and hash tables require comparison or hash functions for any sort of object used. It's possible to define these functions at global scope, but this does complicate use of local variables. C and C++ diverge on this point. C allows nested functions, C++ uses "lambda" functions (note that the word lambda is not used when defining them). For lab 12, use lambda functions to solve each of the 4 exercises.