C++ Introduction
C++ is a statically typed, compiled, general-purpose, case-sensitive, free-form programming language that supports procedural, object-oriented, and generic programming.
C++ is considered aIntermediatelanguage, combining the features of high-level and low-level languages.
C++ was designed and developed by Bjarne Stroustrup starting in 1979 at Bell Labs in Murray Hill, New Jersey; it further extended and improved C, initially named C with Classes, and later renamed C++ in 1983.
C++ is a superset of C; in fact, any valid C program is a valid C++ program.

**Note:** Statically typed programming languages perform type checking at compile time, not at runtime.
Object-oriented programming
C++ fully supports object-oriented programming, including the four major characteristics of object-oriented development:
-
Encapsulation: Encapsulation combines data and methods together, hiding implementation details from the outside and exposing only the provided interface. This improves security, reliability, and flexibility.
-
Inheritance: Inheritance derives new classes from existing classes; the new class has the attributes and methods of the existing class and can extend or modify them. This improves code reusability and extensibility.
-
Polymorphism: Polymorphism means the same operation acting on different objects can have different interpretations and implementations. It can be achieved through interfaces or inheritance, improving code flexibility and readability.
-
Abstraction: Abstraction extracts common features from concrete instances to form abstract classes or interfaces, facilitating code reuse and extension. Abstract classes and interfaces let programmers focus on high-level design and business logic without worrying about low-level implementation details.
Standard library
Standard C++ consists of three important parts:
- The core language, which provides all the building blocks, including variables, data types, and constants, and so on.
- The C++ standard library, which provides a large number of functions for manipulating files, strings, etc.
- The Standard Template Library (STL), which provides a large number of methods for manipulating data structures, etc.
ANSI standard
The ANSI standard ensures the portability of C++ — the code you write can be compiled on Mac, UNIX, Windows, and Alpha computers.
Since the ANSI standard has been stable for a long time, all major C++ compiler manufacturers support the ANSI standard.
Learning C++
To learn C++, the key is to understand concepts rather than dwell too much on the technical details of the language.
The purpose of learning a programming language is to become a better programmer, that is, to design and implement new systems and maintain old ones more efficiently.
C++ supports multiple programming styles. You can write code using the programming style of any language such as Fortran, C, or Smalltalk. Each style can effectively guarantee runtime efficiency and space efficiency.
Uses of C++
The C++ language is widely used in many industries and fields, including:
-
Game development: C++ is one of the most commonly used programming languages in game development because of its high performance and ability to directly control hardware. Many major game engines, such as Unreal Engine and Unity, are written in C++.
-
Embedded systems development: C++ can play an important role in embedded systems, such as smartphones, automobiles, robots, and home appliances. Because embedded systems usually have strict resource constraints and real-time requirements, C++'s high performance and memory control capabilities are very useful.
-
Finance: C++ is widely used in finance, such as high-frequency trading, algorithmic trading, and risk management. Because these applications require high performance and direct control of hardware, C++ is a suitable choice.
-
Graphics and image processing: C++ can be used to develop graphics and image processing applications, such as computer vision, computer graphics, and artificial intelligence. Because these applications require efficient computing power and hardware control, C++ is a good choice.
-
Scientific computing and numerical analysis: C++ can be used to develop scientific computing and numerical analysis applications, such as numerical simulation and high-performance computing. Because these applications require efficient computing power and direct hardware control, C++ is a good choice.
Standardization
| Release date | Common name | Notes |
|---|---|---|
| 2020 | C++20, C++2a | ISO/IEC 14882:2020 |
| 2017 | C++17 | Fifth C++ standard |
| 2017 | coroutines TS | Coroutine library extensions |
| 2017 | ranges TS | Provides range mechanism |
| 2017 | library fundamentals TS | Standard library extensions |
| 2016 | concurrency TS | Extensions for concurrent computing |
| 2015 | concepts TS | Concepts library, for optimizing compile-time information |
| 2015 | TM TS | Transactional memory operations |
| 2015 | parallelism TS | Extensions for parallel computing |
| 2015 | filesystem TS | Filesystem |
| 2014 | C++14 | Fourth C++ standard |
| 2011 | - | Decimal floating-point extensions |
| 2011 | C++11 | Third C++ standard |
| 2010 | - | Mathematical functions extensions |
| 2007 | C++TR1 | C++ Technical Report: Library Extensions |
| 2006 | - | C++ Performance Technical Report |
| 2003 | C++03 | Second C++ standard |
| 1998 | C++98 | First C++ standard |