main()
{
f();
}
int f( int i, float fl)
{
printf("function");
}
Why does the above code runs successfully in 'C' and prints
functionwhen it should report an error, as f () is being called before it is declared.When it's running successfully in 'C', then why not in 'C++'. When running in c++ it's showing:
error: 'f' was not declared in this scopeIf it is because of something like the compiler assumes an undeclared function to return an int and accept an unspecified number of arguments, then why does it runs successfully for the function below too ( i.e. when returning the returning type to void instead of int ?
void f ( int i, float fl)
{
printf("function");}