The ‘Invisible’ Philosophy of C++ Design Patterns: Beyond Singleton, Where Else Do We Use Them?

The 'Invisible' Philosophy of C++ Design Patterns: Beyond Singleton, Where Else Do We Use Them?

Click the blue text to follow the author 1. The ‘Invisible’ Mystery of C++ Design Patterns Have you ever thought: apart from the ubiquitous Singleton pattern in daily C++ code, the ‘standard’ implementations of other patterns rarely appear. 1.1. Why Do We Only See Singleton? Design patterns, especially the 23 classic patterns proposed by the … Read more

Building a High-Performance Iterable Circular Buffer with Modern C++ (Complete Code Included)

In embedded systems, network programming, or real-time data stream processing, we often need a fixed-capacity queue structure that supports overwrite. A typical representative of this structure is the Circular Buffer. This article will guide you through implementing a modern C++ style circular buffer from scratch, supporting: ✅ Compile-time fixed capacity✅ Automatic overwrite of the oldest … Read more

Detailed Explanation of C++ Preprocessor and Symbol Constants

Preprocessor and #define Directive Basic Concepts Preprocessor: A program that processes source code before compilation #define: A preprocessor directive used to create symbol constants or macros How it Works: Similar to a global search and replace, but only processes independent tokens Code Example #include <iostream> #include <climits> // Includes definitions for symbol constants like INT_MAX … Read more

A Practical Guide to C++

A Practical Guide to C++

From WeChat Official Account: InfoQ Author | Bartlomiej FilipekTranslator | Wang QiangEditor | Wan Jia C++ is evolving rapidly! For instance, the page count of the C++ standard has increased from 879 pages in C++98/03 to 1834 pages in C++20, an increase of nearly 1000 pages! More importantly, with each revision of C++, we gain … Read more

Understanding Major Upcoming Updates in C++: Core Language of C++20

Understanding Major Upcoming Updates in C++: Core Language of C++20

Selected from modernescpp Author:JP Tech et al. Compiled by Machine Heart Contributors: Panda, Du Wei C++20 (C++ Programming Language Standard 2020 Edition) will be a significant update for the C++ language, introducing a wealth of new features.C++ developer Rainer Grimm introduces the new features of C++20 through a series of blog posts.Currently, this series has … Read more

Introducing a Modern C++ GUI Library: Elements

Introducing a Modern C++ GUI Library: Elements

When developing desktop tools or plugin interfaces, many people first think of Qt or wxWidgets. They are mature and feature-rich, but inevitably feel a bit cumbersome: high learning curve, complex build systems, and significant introduction costs. On the other hand, Dear ImGui is lightweight and flexible, suitable for game tools and debugging UIs, but it … Read more

Stop Writing C++ the C Way! 10 Examples to Upgrade to Modern C++!

Stop Writing C++ the C Way! 10 Examples to Upgrade to Modern C++!

Many students actually write C++ in the style of C. For example, using <span><span>printf</span></span>, frequently using global variables, and starting array indices from 1… These coding practices may run, but they are neither safe nor modern. It is important to know that while C++ is compatible with many features of the C language, modern C++ … Read more

Introduction to the C++ Programming Language

Introduction to the C++ Programming Language

C++ is an efficient, flexible, and powerful programming language widely used in system development, game engines, high-performance computing, and more. It was developed by Bjarne Stroustrup in 1983 at Bell Labs, originally named “C with Classes,” aimed at extending the C language and introducing features of Object-Oriented Programming (OOP). 1. The Evolution of C++: A … Read more

Using Strings in Arrays with C++

Using Strings in Arrays with C++

Basic Usage of String Arrays In C++, we can use character arrays to store and manipulate strings. Here are two of the most common methods to initialize string arrays. Method 1: Initialize with String Literals #include <iostream> #include <cstring> // Provides string functions like strlen() int main() { // Method 1: Initialize with string literals … Read more