Say I have a function in C defined as :
bool check ( int x, int y);
Now if I call it using check(4);
What will be the value of y that is taken?
Code like this can possibly compile only if the function is either undeclared (C89/90) or declared without a prototype (C89/90 and C99).
In any case the behavior will be undefined. If the number and/or type of promoted arguments used in the call do not match those used in the function definition, the behavior is undefined.
6.5.2.2 Function calls
6 [...] If the number of arguments does not equal the number of parameters, the behavior is undefined [...] If the function is defined with a type that does not include a prototype, and the types of the arguments after promotion are not compatible with those of the parameters after promotion, the behavior is undefined
y. Undefined behavior.4matches the first parameter? It could be that you "forgot" the first and not the second parameter.xbeing set to garbage andyto 4. (If you had written "could" rather than "should", I wouldn't have responded.) IMHO it's important to know what "undefined behavior" really means.