Function Signatures

As we know, there are 3 basic parts to a function header: the type, name, and parameter list.
type name(<parameter list>)
int myFunc(int a);          // ok
int myFunc(long a);         // ok
float myFunc(float a);      // ok
double myFunc(double a);    // ok 
float myFunc(int a);        // error, not unique
double myFunc(float a);     // error, not unique
double myFuncA(float a);    // ok, different name

int myFunc (int a, double b);     // ok
int myFunc (double a, int b);     // ok
double myFunc (double x, int y);  // error, not unique
For two functions to be considered identical:
Previous page
Next page

Back to Index
Back to Outline