20, the return type of the function, do not omit

xiaoxiao2021-03-06  84

----------------

When I see a lot of program write functions, I don't pay attention to the return type of the function. If a function does not return a value, please add Void's modification in front of the function. And some programmers are lazy, and what is not modified in the return of Int (because if not modified, the default returns int), this habit is very bad, or for the eEl of the original code, plus int.

Therefore, the return value type of the function is not omitted.

In addition, for Void's functions, we will often forget return, because some C / C compilers are more sensitive, will report some warnings, so even void's function, we should best add Return's statement internally. This contributes to the compilation of the code.

转载请注明原文地址:https://www.9cbs.com/read-107728.html

New Post(0)