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
/*
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);
}
Monday, April 6, 2009
Will C allow passing more or less arguments than required to a function.
Posted by Raghu Kumar on 6:45 AM
RSS Feed
Twitter
Orkut