1 2 3 4 5 6 7 8 9 10 11 12 | #include <stdio.h> double f(); //function declaration int main(void) { printf("%f\n", f(100.0)); } double f(float param) //function definition { return 5 * param ; } |
I2luY2x1ZGUgPHN0ZGlvLmg+CmRvdWJsZSBmKCk7IC8vZnVuY3Rpb24gZGVjbGFyYXRpb24KaW50IG1haW4odm9pZCkgCnsKICAgIHByaW50ZigiJWZcbiIsIGYoMTAwLjApKTsKfQpkb3VibGUgZihmbG9hdCBwYXJhbSkgLy9mdW5jdGlvbiBkZWZpbml0aW9uCnsKICAgcmV0dXJuIDUgKiBwYXJhbSA7IAp9Cgo=
prog.c:7: error: conflicting types for ‘f’ prog.c:8: note: an argument type that has a default promotion can’t match an empty parameter name list declaration prog.c:2: error: previous declaration of ‘f’ was here
-
result: Compilation error (maybe you wish to see an example for C99 strict)


