// file: $(ECE_1111)/labs/01/l01_03/myfuncts_00.cc // // revision history: // 20180724 (JP): initial version // // local include files // #include "myprog.h" // function: set_value // // arguments: // long* value: the input value // // return: the value of the input // // This function simply returns the value of the argument. // long set_value(long* value_a) { value_a = new long[1]; fprintf(stdout, "helloooo class....\n"); *value_a = 27; return (long)1; } // 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) { return value_a; } // function: compute_sum // // arguments: // float value1: the first operand // float value2: the second operand // // return: the sum of the inputs // // This function simply returns the sum of the arguments. // float compute_sum(long value1_a, float value2_a) { return value1_a + value2_a; } // function: recursion // // arguments: // float value2: the operand // // return: the sum of the inputs // // This function simply returns the sum of the arguments. // float recursion(float value1_a) { return recursion(value1_a); } // function: fact // // arguments: // long n: the operand // // return: the factorial of n // // This function simply returns the factorial of the argument. // long fact(long n_a) { if (n_a <= 1) // base case return 1; else return n_a * fact(n_a - 1); }