One thing that should be understandable initially is that overloading function only works if you have a different number or types of arguments.
Thus, a surcharge may be in a form close to
Code:
void foo ()
void foo (int)
void foo (int, int)
but you can not consider overloading
Code:
void foo (int i = 3, int j = 4)
{
/ * What should be done * /
}
void foo (int i = 5, int j = 6)
because the number and type of argument is identical.
Remember that if you give default values for both arguments (as example), you find yourself in a reality with the option of using prototypes
Code:
void foo () / * the default values are used * /
void foo (int i) / * the default value of j is used * /
void foo (int i, int j) / * no default is used * /
Bookmarks