Does C has function overrides? [duplicate]
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?
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.
加载中,请稍侯......
精彩评论