0

Possible Duplicate:
function overloading in C

So I wonder if we can use something like void A(){} and void A(int b){} in same code file?

Community
  • 1
  • 1
Rella
  • 62,177
  • 103
  • 350
  • 621

1 Answers1

7

That's not function overriding, but function overloading.

Anyway no, C doesn't provide it.

The rationale (well, one of them, the one I prefer) is that to provide function overloading you should find a way to give a symbol to a function based also on its parameters, not only on its name.
This would cause a few problems that a low-level language as C wouldn't take.

peoro
  • 24,831
  • 19
  • 94
  • 148