Exploring Pointer Arithmetic in C Language: Part 1

Exploring Pointer Arithmetic in C Language: Part 1

What is the essence of the C language? More than 90% of C engineers would definitely say it is pointers. Pointers are something that C engineers both love and hate. They are often a nightmare for many junior engineers, with terms like dangling pointers, wild pointers, and memory leaks… each one can make you lose … Read more

Memory Leak Issues in C Language

Memory Leak Issues in C Language

Memory leaks occur only in heap memory; they do not happen in stack memory. This is because stack memory automatically releases space after it has been allocated.What is heap memory? How is it stored? First, let’s introduce how heap memory is stored inC code. The function used to dynamically allocate heap memory inC code ismalloc, … Read more

C Language Data Structures: Complete Implementation of a Handwritten HashMap (Reusable + High Performance)

C Language Data Structures: Complete Implementation of a Handwritten HashMap (Reusable + High Performance)

Understanding HashMap in One Image The structure implemented using an array + linked list (chaining method) is shown below:Key Points Recap: HashMap uses an array (buckets), where each bucket stores a conflict linked list (or other structures). The hash function maps the key to a hash value, and then the modulus operation is used to … Read more

Exploring Pointers in C Language (Part 2): Pointer Arrays and Array Pointers

Exploring Pointers in C Language (Part 2): Pointer Arrays and Array Pointers

Continuing from the previous article, we will further discuss pointers in the C language.In C, pointers and arrays are two closely related but often confused concepts. When combined, they form two powerful tools:Pointer Arrays and Array Pointers. 1. Pointer Arrays: A Tool for Managing Collections of Data 1.1 What is a Pointer Array? A pointer … Read more

Five Important Considerations for Microcontroller Embedded Programming

Five Important Considerations for Microcontroller Embedded Programming

In the process of microcontroller programming, if a designer can master multiple programming languages simultaneously, then that designer is undoubtedly a very talented individual. However, mastering assembly, C, and C++ at the same time is quite challenging, and many beginners struggle significantly while learning even one of these languages. This article specifically compiles insights from … Read more

Using TCMSRAM Memory in GD32 Microcontroller

Using TCMSRAM Memory in GD32 Microcontroller

1. Introduction to GD32 Microcontroller Taking GD32F450ZKT6 as an example The GD32F450ZKT6 on-chip RAM is divided into two parts: 192K + 64K = 256K 2. Introduction to memheap Management Algorithm <span>The memheap management algorithm</span> is suitable for systems with multiple addressablenon-contiguous memory heaps. Using memheap memory management simplifies the usage when multiple memory heaps exist … Read more

C Language Issues in Embedded Development

C Language Issues in Embedded Development

Declare a constant using the preprocessor directive #define to indicate how many seconds are in a year (ignoring leap years): #define SECONDS_PER_YEAR (60 * 60 * 24 * 365)UL Write a standard macro MIN that takes two parameters and returns the smaller one: #define MIN(A,B) ((A) <= (B) ? (A):(B)) What is the purpose of … Read more

In-Depth Analysis of VxWorks Memory Management

In-Depth Analysis of VxWorks Memory Management

Efficient memory management is the cornerstone of Real-Time Operating Systems (RTOS). In the embedded field, applications often have extremely high requirements for performance, reliability, and determinism. VxWorks, as the world’s leading commercial RTOS, has played a significant role in critical areas such as aerospace, automotive electronics, industrial automation, and medical devices since its inception. Compared … Read more

Understanding the Destruction Order of Static Objects in C++

Understanding the Destruction Order of Static Objects in C++

In the vast world of C++ programming, the static keyword acts as a low-key yet crucial behind-the-scenes hero, widely used in variables, functions, and class members, playing an indispensable role. From modifying local variables to retain their state, to limiting the scope of functions, and to achieving shared class members, the presence of static is … Read more

C++ Monthly Highlights – Issue 11

C++ Monthly Highlights - Issue 11

This month’s C++ topic overview! (2025-08) 1. Structured Binding Variables Do Not Trigger NRVO #include <iostream>#include <tuple>#include <utility> struct T { T() = default; T(const T&) { std::cout << "Copy constructor called\n"; } T(T&&) noexcept { std::cout << "Move constructor called\n"; }}; std::pair<int, T> foo() { return {std::piecewise_construct, std::forward_as_tuple(42), std::forward_as_tuple()};} T func() { auto [x, … Read more