Day 19: dynamic memory management
Today's learning effect is unsatisfactory. I interrupt from time to time and only learn a little content. I use the structure to make the address book and optimize the address book with the knowledge of dynamic memory allocation. It seems that one mind and two uses are also a skill worth mastering.
1. Why is there dynamic memory allocation
...
Posted by Horizon88 on Wed, 16 Feb 2022 13:03:41 +0100
Introduction and example of timer based on cumbmx
Introduction and example of timer based on cumbmx
This paper will introduce the basic functions and application methods of timer, and take ultrasonic sensor as an example to show its application
Required materials: stm32 single chip microcomputer, stm32cumbmx software, HC_SR04,CH340
The use of serial communication USART is not discussed her ...
Posted by montana111 on Wed, 16 Feb 2022 03:24:50 +0100
Prefix (2D and)
preface
The one-dimensional prefix sum is introduced earlier. The two-dimensional prefix sum is the online upgrade of the one-dimensional prefix sum. The one-dimensional prefix sum is reflected in the array, while the two-bit prefix sum is reflected in the matrix.
1, What are two-dimensional prefixes and?
Based on the one-dimensional prefi ...
Posted by dserf on Tue, 15 Feb 2022 15:19:23 +0100
Implementation of knowledge consolidation source code 6: c language splicing string and cutting string (strsep) code
Network data is transmitted in the form of stream (we must have a specific format when constructing the data to be sent by the client / server).
The integrity and reliable reception of a packet (reliable transmission of tcp and the problem of half packet sticking of data) are not concerned here. You can refer to the above.
The purpose here is ...
Posted by knashash on Tue, 15 Feb 2022 10:49:19 +0100
15 C language advanced dynamic memory management
Dynamic memory management
Significance of dynamic memory allocation Introduction to dynamic memory function
mallocfreecallocrealloc Common dynamic memory errors Several classic written test questions Flexible array
Significance of dynamic memory allocation
We have pointed out the way of memory development:
//Open up four bytes of ...
Posted by Negligence on Tue, 15 Feb 2022 06:50:38 +0100
Fast sorting (recursive and non recursive) c language implementation
Analysis of algorithm design principle
Quick sort is an improvement on bubble sort. The basic idea of quick sort is to divide the data to be sorted into two independent parts through one-time sorting, in which all the data in one part is smaller than all the data in the other part, and then quickly sort the two fractional data respectively acc ...
Posted by renekosterman on Tue, 15 Feb 2022 06:33:28 +0100
[C] Summary of wrong questions in winter vacation
choice question
eg1
What is the output of the following code ()
char a=101;
int sum=200;
a+=27;sum+=a;
printf("%d\n",sum);
A: 327 B: 99 C: 328 D: 72
Answer analysis: Correct answer: D char is a signed type, accounting for 1 byte, that is, 8 bits, of which the highest bit is the sign bit, and the value range is - 128 ~ 127; ...
Posted by nitroxman on Tue, 15 Feb 2022 05:49:42 +0100
C/C + + memo: file operation (reading and writing files)
File operation
The data generated when the program runs belongs to temporary data. Once the program runs, it will be releasedData can be persisted through filesFile operations in C + + need to include header files < fstream >
There are two types of files:
Text file - the file is stored in the computer as ASCII code of textBinary files ...
Posted by JohnResig on Mon, 14 Feb 2022 15:31:21 +0100
Pointer-Pointer Array, Array Pointer
Part1:
Pointer Array Usage Low-level Write Output Normal
Earlier, pointer arrays were mentioned as arrays, which hold pointers. Why does this happen? When we want to give many addresses to a pointer variable, we need a write, which is too cumbersome. The pointer array solves this problem. Take a look at the use of pointer arrays: and definin ...
Posted by subcool on Sun, 13 Feb 2022 18:21:06 +0100
[explain the storage of C language data - integer storage]
preface:
For beginners, there are two major difficulties in C language, one is the pointer class with complex changes, and the other is the related data storage memory distribution. This article focuses on the data storage related to C language
summary:
In C language, there are many types of data. Since it is the storage of data, we can't av ...
Posted by CompuWorld on Sat, 12 Feb 2022 15:00:15 +0100