C++ Programming for Kids (24) Depth-First Search (DFS)

C++ Programming for Kids (24) Depth-First Search (DFS)

1. Overview Depth-First Search (DFS) is a graph traversal algorithm whose core idea is to search as deeply as possible along a path until it can no longer proceed, at which point it backtracks to the previous node and chooses another unexplored path to continue searching. When choosing another unexplored path to continue searching, it … Read more

RPM Packaging Practical Guide: Step-by-Step Instructions to Create an Installation Package for C++ Programs

RPM Packaging Practical Guide: Step-by-Step Instructions to Create an Installation Package for C++ Programs

“Programming Practice Record” is a public account dedicated to sharing software development practices and technologies. We welcome you to follow us and engage in mutual learning and progress. Distributing software on Linux, especially in a corporate environment, is most reliably done by packaging it as an RPM. This is akin to creating a standard installation … Read more

In-Depth Analysis of C++ Unique Patterns: Pimpl Idiom and CRTP

In advanced C++ programming practices, the Pimpl idiom and CRTP (Curiously Recurring Template Pattern) are two very important techniques that address compilation dependencies and static polymorphism issues, respectively. 1. Pimpl Idiom: The Art of Compilation Firewall 1.1 What is the Pimpl Idiom The Pimpl (Pointer to Implementation) idiom, also known as the “compilation firewall,” is … Read more

C++ Inheritance and Constructors: A Beginner’s Guide from a Theoretical Perspective

Inheritance 1. What is the concept? Inheritance is essentially an extension of an existing class’s characteristics, adding new functionalities. The new class created is called a derived class, while the class being inherited from is called the base class. In fact, inheritance is primarily a form of reuse at the class hierarchy level. For example, … Read more

C++ Practice [GESP2506 Level 5] Greatest Common Divisor

GESP Level 5 Practice, Recursion and Greatest Common Divisor, DifficultyGeneral Group. CCF-GESP C++ Assessment Standards Hongyang, WeChat Official Account: Hongyang’s Programming Class CCF-GESP C++ Assessment Standards Comprehensive Guide – [GESP2506 Level 5] Greatest Common Divisor Problem Requirements Problem Description For two positive integers a, b, their greatest common divisor is denoted as gcd(a, b).For k … Read more

Transitioning from a Regular University to Embedded Systems in the Military Industry with an Annual Salary of 144K!

I am a graduate from a regular university in 2024, after nearly 5 months of embedded training, I finally entered the military industry with a salary of 12k*12 (annual salary of 144K). Journey into the Industry Hello everyone, I am a student from the third batch of embedded training. After graduating with a degree in … Read more

Lecture 4: Smart Use of if-else Statements for Decision Making in C++

Lecture 4: Smart Use of if-else Statements for Decision Making in C++

In the previous lecture, we learned about operators used for comparing values. However, mere comparison is not enough for a program to be functional; it also needs to possess “decision-making capabilities.” In this lesson, we will bring our code to life using if and if-else statements. Just like in real life, your program can now … Read more

C++ Practice [GESP2506 Level 2] Counting Right Triangles

C++ Practice [GESP2506 Level 2] Counting Right Triangles

GESP Level 2 practice, loops and enumerations, difficulty beginner. CCF-GESP C++ Assessment Standards Hong Yang, WeChat public account: Hong Yang’s Programming Class CCF-GESP C++ Assessment Standards Comprehensive Guide – [GESP2506 Level 2] Counting Right Triangles Problem Requirements Problem Description A right triangle has two legs and one hypotenuse. Let the lengths of the two legs … Read more

Comprehensive Analysis of C++ Smart Pointer shared_ptr: From Principles to Practical Guide

Comprehensive Analysis of C++ Smart Pointer shared_ptr: From Principles to Practical Guide

1. Overview and Core Features <span>std::shared_ptr</span> is a smart pointer introduced in the C++11 standard library that implements the concept of shared ownership and automatically manages dynamically allocated memory resources through a reference counting mechanism. Compared to traditional raw pointers, <span>shared_ptr</span> significantly reduces the risks of memory leaks and dangling pointers, making it an indispensable … Read more

C++ Programming for Kids (22) Binary Trees

C++ Programming for Kids (22) Binary Trees

1. Overview of Trees Trees are a type of <span>non-linear</span> data structure consisting of a <span>set</span> of n (n ≥ 0) finite nodes. This <span>data set</span> effectively describes the branching and hierarchical characteristics of data. Trees in real life Abstract representation of trees Trees in data structures 1. Characteristics of Trees Tree structures are widely … Read more