C language implements array sorting and grouping odd and even numbers

  There is a problem worth discussing today. The problems are as follows:   Enter an integer array and implement a function to adjust the order of numbers in the array so that all odd numbers in the array are in the first half of the array and all even numbers are in the second half of the array.   First of all, we can write ...

Posted by lelelow on Thu, 02 Dec 2021 19:23:09 -0800

C Primer Plus sixth edition programming exercise Chapter 7 answers

1. Write a program to read the input, stop reading the # characters, and then report the number of spaces, line breaks and all other characters. /*7.12*/ #include<stdio.h> #define STOP '#' #define BLACK ' ' #define NEWLINE '\n' int main() { char ch; int n_black = 0; int n_NEWLINE = 0; int n_others = 0; printf("please enter the char: ...

Posted by allexx_d on Thu, 02 Dec 2021 17:49:53 -0800

Advanced pointer of C language

preface 1. Pointer is a variable used to store address. The address uniquely identifies a piece of memory space. 2. The size of the pointer is fixed 4 / 8 bytes (32-bit operating system / 64 bit operating system). 3. Pointers are typed. The type of pointer determines the step size of ± integer and the permission of operation memor ...

Posted by steved on Thu, 02 Dec 2021 12:25:37 -0800

[AI Vision] Intelligent Drug Delivery Cart - 1. Redisk and Core Code

review Ben delayed his sophomore electrical settings, and was lucky to join the team halfway. The author had not done camera and visual code before (AI electromagnetic), although there were various regrets in the end, but also temporarily learned a lot of new knowledge. Before the assessment, the foundation and development were completed s ...

Posted by Fractal on Thu, 02 Dec 2021 09:16:12 -0800

Pointer and array 1

Let's take a look at such an example. There is an operation of pointer to refer to array //Enter ten numbers and output from large to small #include<stdio.h> void sort(int x[],int n); int main(void){ int i,*p,a[10]; p=a; //Get address for(i=0;i<10;i++) scanf("%d",p++);//Continuous input p=a; //Fetch ad ...

Posted by smilesmita on Wed, 01 Dec 2021 20:20:15 -0800

Supplement to interview questions of 2019 Xiyou linux group

1. The first question is an input judgment, in which the Classl code is used, something related to the address #include<stdio.h> #include<string.h> struct A{ long a; int b; }; int main(){ struct A num ={0x6e694c756f796978}; char ch='0'; for(int i=0;ch;i++){ ch=*((char *)&num+i); printf("%c",ch); } printf("\n"); ret ...

Posted by Leviathan on Tue, 30 Nov 2021 19:16:54 -0800

[RT thread learning notes] learn the C language coding specification of RT thread together

preface Recently, bloggers are learning about RT thread, an open source project, and began to slowly learn and understand its open source code, and slowly began to contact its code specifications. In my opinion, the first step to participate in an open source project is to understand its specifications, of which the code writing specific ...

Posted by dr.wong on Tue, 30 Nov 2021 16:39:11 -0800

Given three numbers, find their maximum or minimum (tentative)

Given three numbers, find their maximum or minimum (tentative) cause Recently, I found this kind of question type in brushing questions and laying the foundation Title Description Write a program, input a, b and c, and output the maximum value. input A row array, a b c output a b c where the largest number sample input 10 20 30 sample output ...

Posted by webster08 on Tue, 30 Nov 2021 16:22:28 -0800

[data structure] two way circular linked list

Structure of bidirectional linked list 1. Each node of the bidirectional circular linked list includes the following parts: 2. The data field in the header node has no practical significance 3. Bidirectional circular linked list For example: Basic operation data structure typedef int LTDataType; typedef struct ListNode { LTDataType ...

Posted by spillage on Tue, 30 Nov 2021 15:27:55 -0800

Design and verification of asynchronous fifo

The book continues from the above. The previous article introduced the slightly simple synchronous fifo, and then began the more complex asynchronous fifo. 1. Difference between synchronous fifo and asynchronous fifo   When there is only one clock in the design, whether all registers use the same one, there will be no transmission speed ...

Posted by Sooz719 on Tue, 30 Nov 2021 12:26:46 -0800