doc/docs/CPlusPlus-main/02_C++的main函数.md
sairate fa9377e4ae docs(book): 添加现代 C++教程及相关代码
- 新增现代 C++ 教程的 Preface 章节,包括英文和中文版本
- 添加 C++ Primer 练习代码
- 新增 Learn C++ 教程的 C++ 开发简介章节
- 添加头文件解析文档
- 更新 mkdocs.yml,包含新教程的目录结构
- 修改项目设置,使用 Python 3.10环境
2025-07-08 09:52:45 +08:00

29 lines
513 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# C++的main函数
# 1. main函数
① main函数是一个程序的入口
② 每个程序都必须有这么一个函数,并且有且只有一个。
```python
//下面11行代码的含义就是在屏幕中输出一个 Hello World
#include<iostream>
using namespace std;
int main() {
cout << "hello C++" << endl; //屏幕显示hello C++
system("pause"); //按任意键继续退出程序
return 0;
}
```
运行结果:
- hello C++
- 请按任意键继续. . .