Introduction to C++
C++ programming language
The C++ programming language is a high-level, compiled, general-purpose programming language with static typing, suitable for creating a wide variety of applications. Today, C++ is one of the most popular and widely used languages.
Its roots lie in the C language, which was developed between 1969 and 1973 at Bell Labs by programmer Dennis Ritchie. In the early 1980s, Danish programmer Bjarne Stroustrup, who was working at Bell Labs at the time, developed C++ as an extension to C. In fact, at first, C++ simply supplemented C with some object-oriented programming features. That’s why Stroustrup himself initially referred to it as “C with classes.”
Subsequently, the new language began to gain popularity. New features were added, making it not just an addition to C but an entirely new programming language. Ultimately, “C with Classes” was renamed C++. Since then, the two languages have developed independently.
The current language standard can be found at https://eel.is/c++draft/
C++ is a powerful language, inheriting C’s rich memory management capabilities. Therefore, C++ is often used in systems programming, particularly in the creation of operating systems, drivers, various utilities, antivirus software, and so on. Incidentally, the Windows OS is largely written in C++. However, the language’s applications are not limited to systems programming. C++ can be used in programs of any scale where speed and performance are important. It is often used to create graphical applications and various applications. It is also particularly popular for creating games with rich, visually rich graphics. Furthermore, mobile development has recently gained momentum, where C++ has also found its application. Even web development can use C++ to create web applications or auxiliary services that support web applications. Overall, C++ is a widely used language, suitable for creating virtually any type of program.
C++ is a compiled language, meaning that the compiler translates C++ source code into an executable file containing a set of machine instructions. However, different platforms have their own specificities, so compiled programs cannot simply be ported from one platform to another and run there. However, at the source code level, C++ programs are largely portable unless they use features specific to the current operating system. The availability of compilers, libraries, and development tools for almost all common platforms allows the same C++ source code to be compiled into applications for these platforms.
Unlike C, C++ allows for object-oriented programming, representing a program as a collection of interacting classes and objects. This simplifies the creation of large applications.
The main stages of development
In 1979-80, Bjarne Stroustrup developed an extension to the C language, “C with Classes.” In 1983, the language was renamed C++.
In 1985, the first commercial version of the C++ language was released, as well as the first edition of The C++ Programming Language, which was the first description of the language in the absence of an official standard.
In 1989, a new version of the C++ language, C++ 2.0, was released, which included a number of new features. After that, the language developed relatively slowly until 2011. However, in 1998, the first attempt to standardize the language was made by ISO (International Organization for Standardization). The first standard was called ISO/IEC 14882:1998, or C++98 for short. Subsequently, in 2003, a new version of the standard, C++03, was published.
In 2011, the new C++11 standard was published, which contained numerous additions and enriched the C++ language with a large number of new features. Since then, several more standards have been released. At the time of writing, the most recent standard, C++20, was published in December 2020. C++23 is expected to be released in 2023.
Compilers and development environments
To write programs in C++, you need at least two components: a text editor to type the source code, and a compiler to accept the source code file and compile it into an executable file. You can choose any text editor you like. I would recommend the cross-platform editor Visual Studio Code, which supports plugins for various languages, including C++.
While choosing a text editor is relatively straightforward—you can choose any—choosing a compiler can be a real challenge. There are currently many different compilers available, each differing in various aspects, particularly in their implementation of standards. A basic list of C++ compilers can be found on Wikipedia, and at https://en.cppreference.com/w/cpp/compiler_support, you can find information about compiler support for the latest standards. Generally, it’s often recommended to become familiar with at least three main compilers:
- g++ from the GNU Project (as part of the GCC compiler suite)
- Clang (available through the LLVM project)
- Microsoft’s C++ compiler (used in Visual Studio)
We’ll look at some of them below. However, throughout this guide, we’ll focus primarily on the g++ compiler (GCC), developed by the GNU Project.
You can also use integrated development environments (IDEs) to create programs, such as Visual Studio, Netbeans, Eclipse, Qt, etc., which make it easier to create applications.
Explore More IT Terms
#
A
- A Guide to SQL Query Formatting
- A/B testing
- Agile
- Algorithm complexity in 5 minutes
- Algorithms and Data Structures in C#
- An overview of the C # programming language
- An overview of the Python programming language
- Anaconda Python
- Android
- Android App Bundle
- Android SDK
- Angular
- Ansible
- Apache
- Apache Airflow
- Apache Kafka
- Apache Tomcat
- App Store
- AppCode
- Array-based stack
- ArrayList
- ASCII
- ASP.NET
- Assembly Language Lessons
B
C
D
- Data Analytics: applications of data analysis in companies
- Data Engineer - Who is it, what does a data engineer do, and an overview of the profession
- Data modeling: what it is, types, and process steps.
- Data preprocessing: a complete guide for beginners and professionals.
- Data structure
- Data structures
- Defining Aliases
- Defining Arrays
- Deque
- Developing a Website from Scratch
- Digital data: understand the importance of this asset for businesses.
- Doubly linked lists
E
F
H
- Handling errors and exceptions
- How to effectively organize your workflow
- How to Learn Java: Tips for Beginner Developers
- How to Learn PHP: A Beginner's Guide
- How to Use S3 Storage in Kubernetes with CSI
- HTML
- HTML and CSS: Definition, Application, and Operating Principles
- HTML and CSS. Layout from Scratch: What to Learn, Where to Learn, and How Long Will It Take?
- HTML Frame Structure
- HTML Link Formatting
I
- if..else construction
- Inheritance in Java: A Complete Guide to Principles and Implementation
- Inserting an Image
- Interactive Python Tutorial – Learn Programming from Scratch
- Interview Problem: Finding a Deleted Element in O(N)
- Interview Scare: The FizzBuzz Challenge
- Introduction to C++
- Introduction to Machine Learning
- Introduction to programming languages
- IT Specialist Resume (CV)
J
K
M
O
P
S
- SFML Graphics Library Tutorials
- SQL commands: see what they are, what the main ones are + examples
- SQL Interview Questions and Tasks
- SQL Lessons
- SQL Stored Procedures
- SQL Syntactic Sugar: The COALESCE Function
- Stack
- Start in analytics: Python or R
- Statistical analysis: importance for decision making.
- String formatting in Python
- Swift Lessons
- switch/match construct
T
W
- What are databases, and why do they need DBMS and SQL?
- What do Linux distributions consist of?
- What is .NET and what is it used for?
- What is a GPU in a computer, in simple terms?
- What is Big Data? Introduction, Types, Characteristics, and Examples
- What is Golang and what is it used for?
- What is Haskell and what is it used for?
- What is Kotlin and what is it used for?
- What is Linux? The History of Linux
- What is machine learning, and how does it work?
- What is Power BI: everything about the data analytics software
- What is the C++ programming language?
- What is the OSI Model: A Complete Explanation of the Seven Layers and Their Role in Networking
- Where to start learning the C programming language?
- Which Linux distribution should you choose? A Linux distribution overview
