Overloading¶
Functions in C¶
In C, everything is simple
A function has a name
The name is the only thing by which functions are distinguished
Not the return type, nor the paraameters
int x(int i);
int ret = x(42);
char *ret = x("huh?");
char *x(char* str);
Functions in C++ — Overloading¶
C++: better
int x(int i);
char *x(const char *str);
int ret = x(42);
char *ret = x("huh?");
char *ret = x(42);