- 论坛徽章:
- 11
|
If the return type of the main function is a type compatible with int, a return from the initial call to the main function is equivalent to calling the exit function with the value returned by the main function as its argument;10) reaching the } that terminates the main function returns a value of 0. If the return type is not compatible with int, the termination status returned to the host environment is unspecified.
说的是 main 函数如果 return, 则 等同于 return 0;
那么, 如果下文我还没看到的部分没有讲其他函数也是这个行为, 那么按照所谓科学精神, 是不是其他函数就不允许类似行为? 至少是个 undefined behavior? |
|