Writing like that is called an old-style function definition.
At this time, parameters that are not specified are automatically declared as int type
int foo(someVar)
is the same as int foo(int someVar)
.
Therefore, foo()
must return the int type, but someVar
of return someVar
does not display an error because it is an int type,
There is no problem outputting "%d"
in the main function.
© 2024 OneMinuteCode. All rights reserved.