The sixth day of punch in learning on November 28, 2021 (Application of structure)

Structure can systematically link several variables together, which can solve a lot of trouble in some examples. Examples are as follows: To register patients for medical treatment, prepare a procedure to arrange the registered patients in the order of medical treatment according to the following principles: Elderly (age ≥ 60)   Age) ...

Posted by chodges on Sun, 28 Nov 2021 12:12:19 -0800

Circular linked list and bidirectional linked list

1, Foreword The sequential storage structure of linear table (such as array) has continuous storage space, so we don't have to worry about the logical relationship between elements. The biggest advantage of linear table is that it can quickly access the elements at any position in the table. The disadvantage of linear table sequential storage ...

Posted by tonchily on Sun, 28 Nov 2021 10:17:26 -0800

new and delete overloads, templates

new and delete Tmp* p=new Tmp();------new operator(Not reloadable) Request memory (call) operator new)Can overload Call construct delete p ;-----delete operator((not reloadable) Call destructor Memory release(operator delete)Can overload void* operator new(size_t size)overloaded function { cout<<"void* operator new(size_t siz ...

Posted by Fredix on Sun, 28 Nov 2021 06:10:33 -0800

Depth first traversal of adjacency table and adjacency matrix (with code debug and detailed comments)

Attach the program effect first: Adjacency table: Adjacency matrix, that is, a two-dimensional array is used to store the relationship between each vertex and the corresponding edge. For example, if there are edges between two vertices, set the subscript corresponding to this two-dimensional array to a non-zero value. As shown below: Undirec ...

Posted by airdee on Sun, 28 Nov 2021 05:30:10 -0800

IO stream and File class

1. IO stream object IO: input output IO is used to flow data from one device to another Data files flow from disk to memory, from disk to mobile storage device, and from one computer to another Everything is bytes: any data file is composed of bytes, and bytes are the smallest storage unit in the computer (Java source code, games, music, mov ...

Posted by bhavin_85 on Sun, 28 Nov 2021 05:24:33 -0800

C language selection structure and loop structure

1, Select structure 1. if select statement (1) Single branch if statement Syntax structure:   if(Conditional judgment expression){ sentence; } If the value of the conditional judgment expression is true, execute the statement; If false, the statement is not executed. Example: enter two integers and output the largest of ...

Posted by Kane250 on Sun, 28 Nov 2021 02:04:29 -0800

C language file operation details

preface In C language, file is an important concept in programming. The operating system manages data in the unit of files. Although there may not be many places to use files in the future, files are still an indispensable part of C language. Well, no more nonsense. Let's get straight to the point. 1, What is a file Concept: files on dis ...

Posted by Tjeuten on Sat, 27 Nov 2021 21:25:53 -0800

Nanjing University of Posts and telecommunications operating system experiment 4: simple file system simulation experiment

Experiment purpose and requirements Understand the file system composition and basic principle of the operating system, use these knowledge to simulate a FAT file system in memory, complete the file creation and indexing functions, and realize the following command interfaces:         (1) New file, format: ...

Posted by DapperDanMan on Sat, 27 Nov 2021 19:45:00 -0800

Chapter II overview of C language

Chapter II overview of C language 1. Simple C program example cat first.c #include <stdio.h> int main(void) { int num; num = 1; printf("I am a simple "); printf("Computer. \n"); printf("My favorite number is %d besause it is first.\n",num); return 0; } Compilation execution: [root@hans ~]# gcc -o first fir ...

Posted by zingbats on Sat, 27 Nov 2021 19:10:10 -0800

[application example of STM32+OLED screen display]

1, Related technology . 1.1 about SPI protocol SPI protocol is a communication protocol (Serial Peripheral Interface) proposed by Motorola, that is, serial peripheral The standby interface is a high-speed full duplex communication bus. It is widely used between ADC, LCD and MCU, Occasions requiring high communication rate. SPI physical layer S ...

Posted by cdickson on Fri, 26 Nov 2021 19:45:40 -0800