// file: lecture_19/myfuncts_00.cc // // revision history: // // 20180724 (JP): initial version // // local include files // #include "example.h" // function: set_value // // arguments: // float value: the input value // // return: the value of the input // // This function simply returns the value of the argument. // float set_value(float value_a) { fprintf(stdout, "*> entering call by value\n"); value_a = 10.0; return value_a * (float)2.0; } // function: set_value (by pointer) // // arguments: // float* value: the input value // // return: the value of the input // // This function simply returns the value of the argument. // float set_value(float* value_a) { fprintf(stdout, "*> entering call by reference\n"); *value_a = 10.0; return *value_a * (float)2.0; }