《The C Programming Language》的笔记-第72页
- 章节名：4.2 Functions Returning Non-integers
- 页码：第72页 2016-12-20 06:25:56
这就是implicit function declaration的规定啊：If a name that has not been previously declared occurs in an expression and is followed by a left parenthesis, it is declared by context to be a function name, the function is assumed to return an int, and nothing is assumed about its arguments. Furthermore, if a function declaration does not include arguments, as in double atof(); that too is taken to mean that nothing is to be assumed about the arguments of atof; all parameter checking is turned off. This special meaning of the empty argument list is intended to permit older C programs to compile with new compilers. But it’s a bad idea to use it with new programs. If the function takes arguments, declare them; if it takes no arguments, use void.
说明 · · · · · ·