> For the complete documentation index, see [llms.txt](https://mqjyl2012.gitbook.io/algorithm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mqjyl2012.gitbook.io/algorithm/c-cpp/c++-syntax.md).

# C++基础语法

C++是C的超集，C++支持面向过程编程、面向对象编程、泛型编程。

## **一、C/C++编译器**

* **Turbo C/C++：**&#x44;OS时代的启蒙先驱，上古神器。
* **Visual C++：**&#x4D;icrosoft Visual C++（简称Visual C++、MSVC、VC++或VC）是微软公司的C++开发工具，具有集成开发环境，可提供编辑C语言，C++以及C++/CLI等编程语言。Windows下的事实兼容性标准。6.0版一代经典，至今仍然老而不死，死而不僵，僵而不化地毁人不倦。最新版是2015。现在已经有功能相当完整的免费社区版，唯一的使用限制是超过5人的商业机构不得闭源商用。
* **Borland C++：**&#x4E00;代传奇宝蓝的作品，Turbo C/C++的进化版，可惜掩盖在自家王牌Delphi和外敌Visual C++的光芒之下，远没有这两者的历史地位高。
* **LCC-Win32：**&#x5F53;年偶然发现的小品C编译器，编译速度很不错。不过并未进入过主流。
* **gcc/g++：**&#x47;NU社区的神作，各大\*NIX平台上的编译器的事实标准。直到近年来clang的兴起才开始受到挑战。
* **clang：**&#x6700;年轻的成员之一，BSD社区的倚天神剑，开发迅速，对标准的支持也相当好，大有挑翻gcc/g++的势头。FreeBSD已经将其列为默认编译器。
* **Intel C++：**&#x53F7;称生成的代码质量最高，优化最到位的C++编译器。但是有朝AMD的CPU下黑手的案底。

## **二、标准**

1. C++ 98 标准C++标准第一版，1998年发布。正式名称为ISO/IEC 14882:1998。
2. C++ 03 标准C++标准第二版，2003年发布。正式名称为ISO/IEC 14882:2003。
3. C++ 11 标准C++标准第三版，2011年8月12日发布。正式名称为ISO/IEC 14882:2011。C++11标准由国际标准化组织（ISO）和国际电工委员会（IEC）旗下的C++标准委员会（ISO/IEC JTC1/SC22/WG21）于2011年8月12日公布 ，并于2011年9月出版。2012年2月28日的国际标准草案(N3376)是最接近于C++11标准的草案（仅编辑上的修正）。C++11对容器类的方法做了三项主要修改。首先，新增的右值引用使得能够给容器提供移动语义。其次，由于新增了模板类initilizer\_list，因此新增了将initilizer\_list作为参数的构造函数和赋值运算符。第三，新增的可变参数模板（variadic template）和函数参数包（parameter pack）使得可以提供就地创建（emplacement）方法。  自C++11之后，C++标准委员会每三年发布一个新标准，时间控制非常严格。所以出现了C++14、C++17、C++20。
4. C++ 14 标准C++标准第四版，2014年8月18日发布。正式名称为ISO/IEC 14882:2014。C++14是C++11的增量更新，主要是支持普通函数的返回类型推演，泛型 lambda，扩展的 lambda 捕获，对 constexpr 函数限制的修订，constexpr变量模板化等。
5. C++17 标准C++17 是继 C++14 之后，C++ 编程语言 ISO/IEC 标准的下一次修订的非正式名称。2017年12月，ISO C++ 委员会正式发布了 C++ 17 标准，官方名称为 ISO/IEC 14882:2017。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mqjyl2012.gitbook.io/algorithm/c-cpp/c++-syntax.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
