Preface: bloggers have written two interesting small projects before: tic-tac-toe and mine clearance Next, the blogger continues to update a small project - address book, including three versions, static version, dynamic version and file saving version. Next, let's explain how to implement the static version.
1, Overview of static ...
Posted by keystroke on Tue, 28 Sep 2021 06:19:45 +0200
11. Mutex initiate static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; The memory unit is not released until the process is completed dynamic initialization pthread_mutex_t mutex; // Define mutex objects pthread_ mutex_ init(&mutex, NULL); // Allocate kernel resources ... pthread_ mutex_ destroy(&mutex); // F ...
Posted by xiledweb on Mon, 27 Sep 2021 10:14:29 +0200
Dynamic memory allocation
If you can open up memory at will and open it as you use it, can you make the use of memory more efficient? There will be no situation where more development can't be used up and less development can't be used up. Dynamic memory development solves this problem.
Open up location
Memory can be roughly divide ...
Posted by stuffradio on Sun, 26 Sep 2021 11:57:15 +0200
Pointer is the key and difficult point of C language. Mastering pointer skillfully can better understand the storage mode of calculation, simplify the code and enhance the efficiency of the program.
1, Pointer overview
A pointer is a variable that holds the address (number) of the memory unit.
When defi ...
Posted by coldfused on Sat, 25 Sep 2021 20:54:37 +0200
recently, I was reviewing the data structure. In order to deepen my understanding of B-tree, I sorted out the following notes, and then implemented B-tree in C language; I haven't used C language for a long time. Some parts of the code don't conform to the specification or there are problems in understanding this article. Please co ...
Posted by EverToDesign on Sat, 25 Sep 2021 06:02:33 +0200
When reading and writing a file as characters, you can read one character from the file or write one character to the file at a time. Two functions are mainly used: fgetc() and fputc().
Character reading function fgetc
Fgetc is the abbreviation of file get char, which means to read a character from the specified file. The usage of fge ...
Posted by bigbstanley on Fri, 24 Sep 2021 16:08:14 +0200
This issue is the 15th section of C + + basic syntax sharing. Today, let's sort out the top five of the top ten sorting algorithms!
Bubble sorting idea:
1. Compare adjacent elements. If the first one is bigger than the second, exchange them.
2. Do the same work for each pair of adjacent elements, from the first pair at the ...
Posted by private_guy on Fri, 24 Sep 2021 12:58:18 +0200
Experiment 2 of Linux operating system: process communication
Further improve the ability of C programming in Linux environment, understand and be familiar with a variety of IPC mechanisms supported by Linux. As a multi task and multi process operating system, information interaction between processes is inevitable. Inter pr ...
Posted by hobeau on Fri, 24 Sep 2021 12:17:51 +0200
We all know that C language provides us with many built-in library functions, and these library functions need to refer to their respective header files when they are used.
This article is about several string related functions in < string. H >.
1.strlen() - count the number of characters in the string
one point one   ...
Posted by sweyhrich on Fri, 24 Sep 2021 10:28:34 +0200
Hash lookup (hash)
In the search of linear tables and tree tables, there is no definite relationship between the position of records in the table and the keywords of records. Therefore, a series of keyword comparison is required when searching records in these tables. This kind of search method is based on "comparison", and the effic ...
Posted by jungalist on Thu, 23 Sep 2021 11:43:14 +0200