Summary of Common Linux Hooking Techniques

Summary of Common Linux Hooking Techniques

01Hook FunctionsHook functions are predefined hooks in a program that allow you to attach or register a hook function when needed, making it available for the target.If there are no hooks, you can also obtain function pointers to encapsulate functions, but this can only be attached before or after the function runs, not during its … Read more

How to Write Maintainable Embedded Programming Code?

How to Write Maintainable Embedded Programming Code?

1 Object-Oriented C Object-oriented languages are closer to human thinking patterns, significantly reducing code complexity while enhancing code readability and maintainability. Traditional C code can also be designed to be readable, maintainable, and of lower complexity. This article will illustrate this with a practical example. 2 Basic Knowledge 2.1 Structures In addition to providing basic … Read more

Applications of Pointers in C Language Textbooks: A Comprehensive Overview

Applications of Pointers in C Language Textbooks: A Comprehensive Overview

For more exciting content, please click the blue text above to follow me! Continuing from the previous article《C Language Textbook: A Summary of Pointer Applications, Sharing the Differences Between Various Applications, and Unraveling the Mysteries of Pointer Usage(1)》 where we shared part of the content, this article continues. The table below summarizes the applications of … Read more

C Language Special Topic: 8. Function Pointers

C Language Special Topic: 8. Function Pointers

In C language, functions are also a type of “object”, which have addresses in memory. Therefore, it is possible to define pointers to functions, which can be used for dynamic calls, callback handling, building function tables, etc. Mastering function pointers is key to understanding the “low-level abstraction” and “modular programming” in C language. 1. Basic … Read more

Embedded Development in C: Function Pointers and the typedef Keyword

Embedded Development in C: Function Pointers and the typedef Keyword

1. The typedef Keyword In C language, the typedef keyword is used to define a new name (alias) for an existing data type. It does not create a new data type but provides a more readable and concise identifier for existing types, thereby improving code readability and maintainability. The basic syntax of typedef is very … Read more

C++ Interview Questions – May Edition

C++ Interview Questions - May Edition

1. Static Functions, Const Functions, and Virtual Functions Static Functions Static functions cannot be defined as virtual functions. They belong to the class itself, not to instances of the class, and do not have a <span>this</span> pointer. Virtual function calls depend on the object’s virtual function table, requiring the <span>this</span> pointer for location, while static … Read more

Implementation Methods and Examples of Polymorphism in C Language

Implementation Methods and Examples of Polymorphism in C Language

Implementation Methods and Examples of Polymorphism in C Language In object-oriented programming, polymorphism is an important concept that allows the same method to be called in different forms through various means. In C language, although there is no direct syntax support for polymorphism, we can achieve similar effects through the following methods: function pointers, combinations … Read more

Decorator Pattern: Implementation and Advantages in C Language

Decorator Pattern: Implementation and Advantages in C Language

Decorator Pattern: Implementation and Advantages in C Language The Decorator Pattern is a structural design pattern that allows adding new functionality to existing objects without altering their structure. This flexible design enables programmers to dynamically add additional responsibilities or behaviors to an object at runtime. The decorator pattern is particularly important when there is a … Read more

Learning C Language: Part Eight

Learning C Language: Part Eight

Three Essential Elements of a Function Functionality, Parameters, Return Value. 1. Function Exercises 1. Define four functions to implement the operations of two integers: +, -, *, / my_add my_sub my_mul my_div After writing, test the functionality yourself. #include <stdio.h> int my_add(int x, int y); int my_sub(int x, int y); int my_mul(int x, int y); … Read more

C Language Basics – Using Function Pointer Arrays for String Cleaning

C Language Basics - Using Function Pointer Arrays for String Cleaning

#include <stdio.h> #include <string.h> #include <ctype.h> typedef void (*funcPtr)(char *); // 1. Remove leading and trailing whitespace (similar to Python's strip) void trim(char *str) { int i = 0, j; int len = strlen(str); // Remove leading whitespace while (isspace(str[i])) i++; // Remove trailing whitespace j = len – 1; while (j >= 0 && … Read more