www.thecareerplus.com
The CareerPlus
Home Technical Resources Programming Functions
Thursday 09th September 2010
 
 
Will C allow passing more or less arguments than required to a function.

Discuss it!          


It wont if the prototpe is around. It will ideally scream out with an error like

Too many arguments or Too few arguments But if the prototype is not around, the behavior is undefined. Try this out #include <stdio.h> /* int foo(int a); int foo2(int a, int b); */ int main(int a) { int (*fp)(int a); a = foo(); a = foo2(1); exit(0); } int foo(int a) { return(a); } int foo2(int a, int b) { return(a+b); }

Discuss it!          

CrackTheIntervew.NET
Advertisement
 
Top! Top!