It really is (well, it may depend on which standard you use). You should read something about calling conventions .
Basically, if f takes one or nothing arguments, I would not expect any problems.
If f takes two or more arguments, it can be expected that other arguments (other than the first) will have undesirable (apparently random) values.
Consider this piece of code:
int f(int x, int y); int g(int x) { int k; //No value if (x<0) return f(x, k); else return f(x, x); }
Of course, this is a bad idea. You must explicitly specify all arguments.
You can also use int f(void); to explicitly declare that f does not accept any arguments.
Remember that overloading C ++ functions can cause problems, but I assume this is not a concern, since you noted your question with c . In addition, some challenges can cause serious problems.
source share