// C ++ allows functions with similar functions to be declared with the same function name in the same scope to form overloading. Easy to use and easy to remember. // Int add (int x, int y); // float add (float X, float y); different parameter types // int add (int x, int y ); // int add (int x, int y, int Z); different parameters must have different numbers or different types. // The Compiler selects the function to be called Based on the optimal match between the type and number of real parameters. // 1. the compiler does not distinguish them by form parameters; // 2. the compiler does not distinguish between return values. // 3. do not declare functions of different functions as overload functions to avoid misunderstanding or confusion of call results. # Include <iostream. h> struct Complex {double real; double imaginary;}; int add (int m, int N) {return m + n;} double add (Double X, Double Y) {return X + Y;} complex add (complex C1, complex C2) {Complex C; C. real = c1.real + c2.real; C. imaginary = c1.imaginary + c2.imaginary; return C ;}int main (void) {int M, N; Double X, Y; complex C1, C2, C3; int add (INT m, int N); double add (Double X, Double Y); complex add (complex C1, complex C2); cout <"enter two integer :"; cin> m> N; cout <"integer" <m <'+' <n <"=" <add (m, n) <Endl; cout <"enter two real number:"; CIN> x> Y; cout <"real number" <x <'+' <Y <"=" <add (x, y) <Endl; cout <"Enter the first complex number:"; CIN> c1.real> c1.imaginary; cout <"enter the second complex number:"; CIN> c2.real> c2.imaginary; c3 = add (C1, C2); cout <"complex number (" <c1.real <',' <c1.imaginary <") + ("<c2.real <',' <c2.imaginary <") = ("<c3.real <',' <c3.imaginary <") \ n "; return 0 ;}