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
  • 65,003
  • 109
  • 363
  • 636

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
  • 25,562
  • 20
  • 98
  • 150