Basic syntax of C language Chapter 11 - flexible array

Why do we need flexible arrays? #define MAXLEN 1024 struct kd_node { struct kd_node*left; struct kd_node*right; int dim; unsigned long long data[MAXLEN]; }; In this code, in order to store data, an unsigned long long array with a length of 1024 is applied. If the array length is much smaller than MAXLEN. This design will be an extremely ...

Added by joseph on Thu, 06 Jan 2022 02:31:27 +0200

Application of pointer

1, The concept of pointer The pointer is actually a location where the address is stored. It is the same as the ordinary constant data defined by us. They only store different contents. Therefore, when using the pointer, we need to pay attention to the specific contents we store. In addition, the pointer can store the address of the pointer. ...

Added by Pedro Sim on Thu, 06 Jan 2022 00:44:38 +0200

C language string function

1, strlen() function The strlen() function counts the length of a string. #include <stdio.h> #include <string.h> int main() { char *p = "hello world"; int len = strlen(p); printf("p strlen[%d]\n", len); return 0; } 2, strcat() function strcat() is used to splice strings, receive two ...

Added by disconne on Wed, 05 Jan 2022 23:53:48 +0200

[C language] operator details 1 - & bitwise and | bitwise OR ^ bitwise XOR ~ bitwise negation & & Logic and | logical or

1, Arithmetic operator Arithmetic operators + - * /% //% - Take mold //& modulo operators can only be used for integer types int main() { int ret1 = 9 / 2; printf("%d\n", ret1); // 4 // For both sides of / (division sign) are integers, integer division is performed double ret2 = 9 / 2.0; printf("%lf\n", ret2); // 4.500000 ...

Added by eRott on Wed, 05 Jan 2022 22:13:44 +0200

Introduction to C language 130 questions - OJ

BC1 practice produces true knowledge #include <stdio.h> int main() { printf("Practice makes perfect!\n"); return 0; } BC2 I'm big V #include <stdio.h> int main() { printf("v v\n v v \n v \n"); return 0; } BC3 has capacity #include <stdio.h> int main() { printf("The size of short is %d b ...

Added by rharter on Wed, 05 Jan 2022 21:50:50 +0200

Basic Experiment 1: light up 2 LED lights

Catalogue of series articles Porting Linux 0.0 GPIO operation from 11 to Hi3518EV200 development board preface By lighting the LED light through basic experiments, you can be familiar with some basic knowledge of the target hardware platform, such as memory address space range, how to configure multiplexing pins, how to operate GPIO, ho ...

Added by adamski on Wed, 05 Jan 2022 17:46:30 +0200

Bidirectional linked list of data structure (implemented in C language)

Several insertion, deletion and specified location output of bidirectional linked list Appearance of two-way linked list A two-way linked list is composed of a precursor pointer, a descendant pointer and a data field. The front and back pointers between nodes are connected to form a linked list Encapsulation of bidirectional linked list no ...

Added by clio-stylers on Wed, 05 Jan 2022 17:09:32 +0200

C language - basic function query

Preparation of program design experiment course ----Do a convenient mobile keyword search library, and then realize the timely information retrieval function ----After doing a simple C language introduction tutorial, send it to CSDN - thank you for the header song support provided by boss Wang Tinghao ----After improvement: make some necessa ...

Added by Megalink on Wed, 05 Jan 2022 15:51:58 +0200

(the rookie can also handle it easily!) C language must do small projects - mine sweeping

catalogue Project introduction File creation menu Create chessboard Initialize chessboard Print chessboard Lay mines Demining Complete code Project introduction Like Sanzi, this project can be easily dealt with after learning functions and arrays. Rules of mine sweeping: enter the coordinates of a grid randomly, and a number will ...

Added by les4017 on Wed, 05 Jan 2022 12:50:14 +0200

PAT class B 1015 question brushing record

Let's look at the topic first: 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 ...

Added by murtuza.hasan.13 on Wed, 05 Jan 2022 06:32:50 +0200