Find the union of two integer sets

All of them. Recently, Xiaobai encountered the problem of finding non repeated numbers when doing questions. Today, I'm here to share and record my method with you. First, we need to input these two sets and combine them into an array. Here I choose to use an array continuous input for (i = 0; i < n; i++) scanf("%d", a+i); scanf("%d", & ...

Posted by kidd1270 on Thu, 28 Apr 2022 08:50:53 +0300

Linux network development tutorial 6_ Network programming under window

socket interface has been widely used in modern operating systemsThe socket programming interface under Windows is almost the same as that in LinuxDifferencesDifferent return types (handle types)The handle is not a file descriptor, and not all files are connected in Window (therefore, send and recv cannot be used for socket s in windows)Usage o ...

Posted by iphone2008 on Thu, 28 Apr 2022 05:12:18 +0300

C language - process management

Basic concepts of process A process is an execution process of a program with certain functions about a data set. The Linux system supports multiple processes at the same time. A priority is set in the security information in each process attribute. The system determines the size of the time slice obtained by each process from the CPU acco ...

Posted by nevillejones on Tue, 26 Apr 2022 14:58:10 +0300

Section 11: dynamic memory allocation, secondary pointer, sizeof

Pointers are variables used to store address data NULL indicates an empty address Pointer variables that record invalid addresses are called wild pointers The pointer can participate in the following mathematical calculations Pointer + integer, pointer integer, pointer pointer pointer All the units in the pointer are determined by the integer ...

Posted by cgm225 on Tue, 26 Apr 2022 03:10:02 +0300

C language notes based on Windows10 and Linux I

WSL 1 What is WSL??? I have a Windows 10, but I think Linux is the best system, so I need to install a Linux virtual machine as the programming environment. Of course, if you only insist on using the IDE on Windows or if you are a big guy using Notepad, please skip all the following contents directly. At the same time, this is a note w ...

Posted by metin on Mon, 25 Apr 2022 21:02:58 +0300

Embedded C second task

  1.Typedef definition: typedef is a key word of C language. It is used to define a new name for a data type. effect: One is to give variables a new name that is easy to remember and has clear meaning. The other is to simplify some complex type declarations. typedef unsigned char BYTE; After this type is defined, the identifier BYTE (usu ...

Posted by zszucs on Mon, 25 Apr 2022 20:05:19 +0300

Redis0.1 source code reading notes

preparation The code of redis-0.1 is downloaded from the network. This version has a small amount of code and is easy to understand. It also contains many basic ideas and theories of the author in developing redis. It is a good source code reading material. from Redis source code download address After downloading, unzip it to the directory sp ...

Posted by erupt on Mon, 25 Apr 2022 12:30:55 +0300

C language string, escape character, operator

Notes on string, escape character and operator 1. String End flag of string: \ 0 Find the length of the string: use the strlen function Add a '\ 0' character to the arr2 array to print abc correctly char arr1[] = "abc"; //Memory storage form: abc ABC \ 0 char arr2[] = {'a','b','c'}; //Memory storage form: abc????????? //Print string pri ...

Posted by tpc on Sun, 24 Apr 2022 16:19:39 +0300

Linux network development tutorial 1_ Core concepts and models of network programming

Question: how to program the network?The essence of network programmingUsing the interface function provided by the operating system, the application program has the ability to send and receive network dataThe network interface is a function provided by the operating system at the code levelNetwork programming is just a fancy way to play a seri ...

Posted by gilmourt on Sun, 24 Apr 2022 13:04:21 +0300

MCU C language operation__ Modular thought__ 1. Automatic initialization

My sharing comes from the perception in the actual design process We can't guarantee the correctness of the sharing results. If there are mistakes, please point them out. I will study with an open mind. Thank you!!! 1, Common driver initialization methods: When we are writing the MCU program, we don't know whether there is a feeling that ...

Posted by jOE :D on Sun, 24 Apr 2022 08:16:23 +0300