The road to learning C++—1. Introduction to C++

Introduction to C++

        C++ is a statically typed, compiled, general-purpose, case-sensitive, irregular programming language that supports procedural programming, object-oriented programming, and generic programming.
        C++ is considered a middle-level language that combines the features of high-level and low-level languages. C++ was designed and developed by Bjarne Stroustrup in 1979 at Bell Laboratories in Murray Hill, New Jersey. C++ further expanded and improved the C language, originally named C with classes, and later renamed C++ in 1983. C++ is a superset of C. In fact, any legal C program is a legal C++ program.

Note: Programming languages ​​that use static typing perform type checking at compile time rather than at run time.

object-oriented programming

C++ fully supports object-oriented programming, including the four major characteristics of object-oriented development:

  • Encapsulation : Encapsulation is the combination of data and methods, hiding implementation details from the outside, and only exposing the interface provided to the outside world. This improves security, reliability and flexibility.

  • Inheritance : Inheritance is the derivation of a new class from an existing class. The new class has the properties and methods of the existing class, and can extend or modify these properties and methods. This improves code reusability and scalability.

  • Polymorphism : Polymorphism means that the same operation acts on different objects and can have different interpretations and implementations. It can be implemented through interfaces or inheritance, which can improve code flexibility and readability.

  • Abstraction : Abstraction is to extract common features from specific instances to form abstract classes or interfaces to facilitate code reuse and expansion. Abstract classes and interfaces allow programmers to focus on high-level design and business logic without having to pay attention to low-level implementation details.

standard library

Standard C++ consists of three important parts:

  • The core language provides all the building blocks, including variables, data types, constants, etc.
  • The C++ standard library provides a large number of functions for operating files, strings, etc.
  • The Standard Template Library (STL) provides a large number of methods for manipulating data structures, etc.

ANSI standard

The ANSI standard is designed to ensure the portability of C++ - the code you write will compile on Mac, UNIX, Windows, and Alpha computers.

Because the ANSI standard has been stable for a long time, all major C++ compiler manufacturers support the ANSI standard.

Learn C++

The key to learning C++ is to understand the concepts rather than delve too deeply into the technical details of the language.

The purpose of learning a programming language is to become a better programmer, that is, to be able to design and implement new systems more efficiently, as well as maintain old systems.

C++ supports a variety of programming styles. You can write code using any language programming style such as Fortran, C, Smalltalk, etc. Each style effectively guarantees runtime efficiency and space efficiency.

Use 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 due to its efficient performance and ability to directly control hardware. Many major game engines, such as Unreal Engine and Unity, are written in C++.

  • Embedded system development: C++ can play an important role in embedded systems, such as smartphones, automobiles, robots, and home appliances. Because embedded systems often have strict resource constraints and real-time requirements, C++'s efficient performance and memory control capabilities are very useful.

  • Financial field: C++ is widely used in the financial field, such as high-frequency trading, algorithmic trading and risk management. Since these applications require efficient performance and direct control of the hardware, the C++ language is a suitable choice.

  • Graphics and image processing: C++ can be used to develop graphics and image processing applications, such as in the fields of computer vision, computer graphics, and artificial intelligence. Since these applications require efficient computing power and control of hardware, C++ is a good choice.

  • Scientific computing and numerical analysis: C++ can be used to develop scientific computing and numerical analysis applications in areas such as numerical simulation and high-performance computing. Since these applications require efficient computing power and direct control of the hardware, the C++ language is a good choice.

standardization

release time Common name Remark
2020 C++20, C++2a ISO/IEC 14882:2020
2017 C++17 The fifth C++ standard
2017 coroutines TS Coroutine library extension
2017 ranges TS Provide scope mechanism
2017 library fundamentals TS Standard library extensions
2016 concurrency TS Extensions for concurrent computing
2015 concepts TS Concept library for optimizing compile-time information
2015 TM TS transactional memory operations
2015 parallelism TS Extensions for parallel computing
2015 filesystem TS File system
2014 C++14 The fourth C++ standard
2011 - decimal floating point extension
2011 C++11 The third C++ standard
2010 - Math function extension
2007 C++TR1 C++ Technical Report: Library Extensions
2006 - C++ Performance Technical Report
2003 C++03 The second C++ standard
1998 C++98 The first C++ standard

Guess you like

Origin blog.csdn.net/m0_48241022/article/details/133324758