mirror of
https://github.com/wangdoc/clang-tutorial.git
synced 2026-02-03 10:53:37 +08:00
docs(function): fixeded #44
This commit is contained in:
@@ -96,11 +96,11 @@ int main(void) {
|
||||
|
||||
C 语言约定,返回值`0`表示函数运行成功,如果返回其他非零整数,就表示运行失败,代码出了问题。系统根据`main()`的返回值,作为整个程序的返回值,确定程序是否运行成功。
|
||||
|
||||
正常情况下,如果`main()`里面省略`return 0`这一行,编译器会自动加上。所以,写成下面这样,效果完全一样。
|
||||
正常情况下,如果`main()`里面省略`return 0`这一行,编译器会自动加上,即`main()`的默认返回值为0。所以,写成下面这样,效果完全一样。
|
||||
|
||||
```c
|
||||
int main(void) {
|
||||
printf("Hello World"\n);
|
||||
printf("Hello World\n");
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user