C++ Programming
C++ is a systems programming language that extends C with object-oriented features, templates, and a standard library. It provides fine-grained control over memory and hardware while supporting abstractions that scale to large codebases, used in games, databases, browsers, and embedded systems.
itProgramming languages | OpenSkills.info
Intro
C++ Programming
C++ is a general-purpose programming language built around direct control, abstraction, and performance. You can work close to hardware. You can also define classes and templates that hide low-level details behind reusable interfaces.
That range is C++'s central strength. It is also the source of much of its complexity. The language combines decades of features, several programming styles, and a large standard library. Good C++ starts with choosing a small, modern subset that makes ownership and intent visible.
This course gives you a practical map. You will learn how source files become a program, how values and objects behave, how classes manage resources, and how templates support generic code. You will also learn where undefined behavior and unchecked access create risk.
The language, an implementation, and the library
Keep three layers separate:
- The C++ language defines syntax, types, expressions, statements, classes, templates, and program behavior.
- A C++ implementation supplies a compiler, a standard library implementation, and a target execution environment.
- The C++ standard library supplies strings, containers, algorithms, input and output, concurrency facilities, and other reusable components.
ISO/IEC 14882:2024 is the current published C++ standard. It is commonly called C++23 because that is the language revision it standardizes. The standard defines requirements for implementations. It does not prescribe one compiler command, build system, or executable format.
Compilers let you select a language version. Choose one explicitly for a project, such as C++20 or C++23. Check compiler support before depending on a recent feature. A source file accepted by one compiler mode may use extensions that another mode rejects.
From source text to a program
A traditional C++ project contains source files and headers. The preprocessor handles directives such as #include. Each preprocessed source file becomes a translation unit. The compiler produces object code, and the linker combines object files and libraries into a program.
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://www.iso.org/standard/83626.html
Supports
- ISO/IEC 14882:2024 is edition 7 of the published C++ programming language standard
- The standard was published in October 2024 and is the edition commonly associated with C++23
- C++ is a general-purpose language with classes, templates, exceptions, namespaces, overloading, references, free-store operators, and standard-library facilities
- The standard defines C++ and requirements for C++ implementations
- https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf
Supports
- N4950 is the final public working draft that formed the basis of the C++23 international standard
- C++ defines translation units, declarations, definitions, objects, references, types, expressions, statements, functions, classes, templates, and exceptions
- A hosted program contains a global function named main and execution invokes it
- Object and reference lifetimes bound when stored values and referred-to objects may be used
- Undefined behavior places no requirements on an implementation
- The standard library specifies strings, containers, iterators, algorithms, smart pointers, input and output, concurrency, and other facilities
- unique_ptr models unique ownership and shared_ptr uses shared ownership semantics
- Concepts and constraints state requirements for template arguments
- Stack unwinding destroys constructed automatic objects when an exception propagates
- https://www.open-std.org/jtc1/sc22/wg21/docs/standards
Supports
- WG21 publishes public drafts corresponding to C++ standard editions
- N4950 is listed as the draft for the 2023 edition
- WG21 is the ISO working group for C++ standardization
- https://isocpp.org/get-started
Supports
- The Standard C++ Foundation lists compiler options for major operating systems
- The page curates modern C++ learning material and standard-library references
- Compiler installation is the first practical step in its learning path
- https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
Supports
- The C++ Core Guidelines focus on interfaces, resource management, memory management, concurrency, and related high-level concerns
- RAII binds resource lifetime to object lifetime and supports cleanup across error paths
- Prefer scoped objects and resource handles over explicit allocation and deallocation
- Use unique_ptr or shared_ptr to represent ownership when dynamic ownership is required
- Prefer unique_ptr over shared_ptr unless ownership must be shared
- Aim for the rule of zero by composing resource-managing members
- Prefer a standard-library container to a C-style array for ordinary application code
- https://en.cppreference.com/w/cpp/language
Supports
- The C++ language reference organizes object, scope, lifetime, definitions, translation, expressions, classes, templates, exceptions, and undefined behavior
- C++20 introduced modules and concepts
- References, pointers, classes, and templates are distinct language facilities
- https://en.cppreference.com/w/cpp/language/raii
Supports
- RAII binds a resource lifecycle to an object lifetime
- Destruction in reverse acquisition order supports resource release on normal and exceptional exits
- Standard-library strings, vectors, smart pointers, and lock wrappers apply RAII
- Move semantics can transfer ownership while preserving resource safety
- https://en.cppreference.com/w/cpp/language/lifetime
Supports
- Every object and reference has a runtime lifetime
- A reference may remain accessible after the referred object's lifetime and become dangling
- Several forms of access outside an object's lifetime have undefined behavior
- https://en.cppreference.com/w/cpp/container
Supports
- Standard containers organize sequence, ordered associative, and unordered associative data structures
- Containers manage storage for their elements and expose iterator-based access
- Container choice depends on supported operations and workload efficiency
- Iterator invalidation and thread-safety rules depend on operations and container types
- https://en.cppreference.com/w/cpp/container/vector
Supports
- vector is a resizable contiguous sequence container
- vector manages element storage automatically
- Reallocation invalidates all element references, pointers, and iterators
- Unchecked element access does not provide automatic bounds checking
- https://en.cppreference.com/w/cpp/ranges
Supports
- The C++20 ranges library generalizes iterator and algorithm interfaces
- Range views are lightweight representations of iterable sequences
- Range adaptors can compose lazy view pipelines
- https://clang.llvm.org/docs/AddressSanitizer.html
Supports
- AddressSanitizer combines compiler instrumentation with a runtime library
- It detects out-of-bounds access, use after free, invalid free, double free, and other memory errors during execution
- Clang enables AddressSanitizer with the address sanitizer compiler option
- AddressSanitizer does not replace broader design review or prove arbitrary program correctness
- https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
Supports
- UndefinedBehaviorSanitizer adds compile-time instrumentation for selected invalid operations
- Checks include out-of-bounds indexing, misaligned or null pointer use, invalid shifts, and signed integer overflow
- Clang enables the undefined-behavior check group with the undefined sanitizer option
- https://cmake.org/cmake/help/latest/guide/tutorial/index.html
Supports
- The official CMake tutorial is a step-by-step guide to common build-system tasks
- CMake projects declare languages, targets, sources, and compile-feature requirements
- Target-level requirements avoid dependence on implicit local compiler defaults
