example2.cc now expects an output file for the result of inference