Dynamic memory management
catalogue
1. Why does dynamic memory management exist
2. Introduction to dynamic memory function
2.1 malloc
2.2 calloc
2.3 realloc
3 common errors in dynamic memory allocation i
3.1 dereference of NULL pointer
3.2 cross border access to dynamic development space
3.3 free release for non dynamic development memory
3.4} use free to r ...
Posted by zzlong on Tue, 25 Jan 2022 16:48:12 +0100
1015 theory of virtue and talent (25 points) 2 3 4 test points
1015 theory of virtue and talent (25 points)
Sima Guang, a historian of the Song Dynasty, wrote a famous "theory of virtue and talent" in Zizhi Tongjian: "therefore, the perfection of talent and morality is called a saint, the death of talent and morality is called a fool, the victory of virtue is called a gentleman, and the vic ...
Posted by R0bb0b on Tue, 25 Jan 2022 16:24:22 +0100
Linear discrete storage linked list in data structure
In the previous section, we have learned about continuous storage in linear storage. We also call this storage structure sequential table or array. We also know that linear continuous storage has the following advantages and disadvantages:
Advantages: it can quickly add and access elementsDisadvantages: inserting or deleting elements will mo ...
Posted by JustinMs66 on Tue, 25 Jan 2022 15:39:16 +0100
Mine sweeping interface is relatively good-looking version C (1.0)
First, I'll show you the beautiful black frame=
Come on, do it!
catalogue
1: Components of the game
2: Special section summary
(1) Create two 2D arrays:
mine array:
show array:
2: Game implementation logic
3: Array size creation problem
3: code implementation
(1)game.h
(2)game.c
(3)test.c
4: Test game
1: Components of the ga ...
Posted by pahunrepublic on Tue, 25 Jan 2022 10:12:03 +0100
[stetch cup · Cloud Bridge · algorithm training camp] week 3
1. Fibonacci sequence Title Description Fibonacci numbers are usually represented by F(n), and the sequence formed is called Fibonacci sequence. The sequence starts with 1 and 1, and each subsequent number is the sum of the first two numbers. That is:
F(0) = 1,F(1) = 1 F(n) = F(n - 1) + F(n - 2), where n > 1 Here you are n, please calculat ...
Posted by cap2cap10 on Tue, 25 Jan 2022 03:11:20 +0100
Gobang game (implemented in C language)
To realize the game, we must first think about the principle and layout of the game.
First, let's take a look at the board and rules of the game.
The computer (randomly) and the player play the next game at a time, and the two sides take turns until either of the computer and the player wins, or the chessboard is full, and the game ends. Wi ...
Posted by yanisdon on Tue, 25 Jan 2022 00:33:24 +0100
C Programming Example
1
Arbitrary input of three integers, programming to sort the three integers from small to large. Implementation process:
(1) Define the data type. In this example, a, b, c and t are all basic integers.
(2) Use the input function to obtain any three values and assign them to a, b and c.
(3) Use the if statement to make conditional judgment. ...
Posted by febrarian on Tue, 25 Jan 2022 00:06:17 +0100
Learning of math, fmt, io basic package
1, math
Provides basic constants and mathematical functions
1. Absolute value of number
func Abs(x float64 ) float64
exceptional case
Abs(±Inf) = +Inf
Abs(NaN) = NaN
2.func Cbrt(x float64 ) float64
func Cbrt(x float64 ) float64
3.Floor returns the maximum integer value less than or equal to x.
func Floor(x float64 ) float64
4.Ceil r ...
Posted by Disgrntld on Mon, 24 Jan 2022 23:07:56 +0100
Algorithm 06 - patA1016 telephone bill problem (pairing sorting and summation)
Title Description: give the charge (cents/minute) of each hour interval in 24h, and give N call recording points. Each call recording point records the name, current time (month: Day: hour: minute) and whether it belongs to on-line or off-line. Now it is necessary to calculate the tariff of each person's effective call records. Eff ...
Posted by robvan75 on Mon, 24 Jan 2022 21:41:14 +0100
ucore lab3 learning notes sorting
With the help of page table mechanism and interrupt exception handling mechanism, this experiment completes the implementation of page fault exception handling and fifo page replacement algorithm. ucore established mm_struct and vma_struct data structure, which describes the legal memory space required by ucore simulation application. vma_ The ...
Posted by robot_nader on Mon, 24 Jan 2022 21:25:48 +0100