By Mistake I called a function with less parameters that what it has in its prototype , the code compiled with no warnings, so i did the following experiment:
compiled and ran the following code
#include <stdio.h>
void main()
{
printf("1 param %d \n",f(1));
printf("2 params %d \n",f(2,7));
printf("3 params %d \n",f(7,8,9));
}
int f(int a, int b)
{
return (a+b);
}
I compiled it using gcc try.c
it compiled without warnings
and the results were
1 param -557760119
2 params 9
3 params 15
my question is how come the compiler compiled with no issues, even when i called f() function that gets two parameters either with one or three parameters Thanks,