[ThinkingInC ++] 19. Exercises on C (1)
/*** Function: Creates a header file and declares a set of functions with variable parameters. The returned values include void, char, * int, and float. Create a. cpp file that contains the preceding header file and create the definition of all these functions. Each * definition should simply output the function name and parameter list, and return the type to know that it has been called. * Create another. cpp file that contains the header file and defines int main (), in which all defined * functions are called. * Time: August 15, 2014 08:18:02 * Author: cutter_point */# ifndef TEST1_H_INCLUDED # define TEST1_H_INCLUDED # include
Using namespace std; // declare a group of functions with variable parameters. The returned values include void, char, int, float // void, and void fun1 (int ); // char function declaration char fun2 (); // int function declaration int fun3 (float); // float function declaration float fun4 (char); # endif // TEST1_H_INCLUDED
/*** Function: Creates a header file and declares a set of functions with variable parameters. The returned values include void, char, * int, and float. Create a. cpp file that contains the preceding header file and create the definition of all these functions. Each * definition should simply output the function name and parameter list, and return the type to know that it has been called. * Create another. cpp file that contains the header file and defines int main (), in which all defined * functions are called. * Time: August 15, 2014 08:18:08 * Author: cutter_point * // * Create A. cpp file containing the header file and create the definitions of all these functions. Each definition should simply output the function name and parameter list, and return the type to know that it has been called. */# Include "test1.h" # include
Using namespace std; void fun1 (int a) {// output function name, parameter list, and return The type to know that it has been called cout <"The function fun1 (" <