mit6.s081 lab2 System calls

Add mit warehouse Add remote git remote add mit git://g.csail.mit.edu/xv6-labs-2020 Pull branch from mit git fetch mit git checkout syscall chapter 2 System call tracing Write a program to track the system call called by another program, print the syscall num and syscall num of the tracked syscall, and the return value of calling sysca ...

Posted by UseeHere on Sat, 02 Oct 2021 22:31:54 +0200

C language - four operations of stack (with decimal point and parentheses)

Idea: The whole process is to traverse the string of the required operation input once Each time an element is judged and operated, there are two stacks (a number stack and a symbol stack) (1) If it is a number, put it on the number stack, and then continue to operate on the element in the next string Here are some operations on parentheses: I ...

Posted by tommix on Sat, 02 Oct 2021 05:04:49 +0200

C language partner problem PTA

Partner problem PTA describe Assuming that the records of men and women are stored in an array, an algorithm is designed to realize partner pairing. It is required to output the paired partner and the name of the team head element without pairing. Sample sample input Li minhao M Li zhongshuo M Gao Xinya F Wu Yanzu M Wang Sicong M Zhang Ti ...

Posted by Haroskyline on Sat, 02 Oct 2021 01:04:33 +0200

Week 9: array + pointer + string

1. Transpose of two-dimensional array matrix Title: Please write a function to transpose an integer matrix of m*n. Note: Please store the transposed data in the two-dimensional array before outputting the two-dimensional array. Three transposes are required using the following three functions: void Transpose1(int a[][N], int at[][M], int m, ...

Posted by jokullsolberg on Sat, 02 Oct 2021 00:29:09 +0200

C language learning - Weng Kai (Chapter 4 notes)

C language Chapter IV 4.1.1 cycle Count a few digits The program should read in a positive integer with less than 4 bits (including 4 bits), and then output the number of bits of this integer. For example:Input 352. Output: 3 Human VS Computer Human way: you can see it with your eyes 352 - > 3 digits! The way of computer: determine ...

Posted by Zpixel on Fri, 01 Oct 2021 22:42:40 +0200

[postgraduate entrance examination] sequence list and linked list

Sequential table structure Static allocation of sequential storage #define MaxSize 50 / / define the maximum length of a linear table typedef int Elemtype//Assume that the element type in the table is int typedef struct{ ElemType data[MaxSize];//Elements of sequential table (array) int length ;//Current length of sequence table } Dyna ...

Posted by no_one on Thu, 30 Sep 2021 21:55:44 +0200

C language implementation of address book (static version)

Preface: bloggers have written two interesting small projects before: tic-tac-toe and mine clearance Next, the blogger continues to update a small project - address book, including three versions, static version, dynamic version and file saving version. Next, let's explain how to implement the static version. catalogue 1, Overview of static ...

Posted by keystroke on Tue, 28 Sep 2021 06:19:45 +0200

Multithreaded programming

11. Mutex initiate static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;      The memory unit is not released until the process is completed dynamic initialization pthread_mutex_t mutex; // Define mutex objects pthread_ mutex_ init(&mutex, NULL); // Allocate kernel resources ... pthread_ mutex_ destroy(&mutex); // F ...

Posted by xiledweb on Mon, 27 Sep 2021 10:14:29 +0200

[learn C together] dynamic memory allocation

Dynamic memory allocation preface: If you can open up memory at will and open it as you use it, can you make the use of memory more efficient? There will be no situation where more development can't be used up and less development can't be used up. Dynamic memory development solves this problem. Open up location Memory can be roughly divide ...

Posted by stuffradio on Sun, 26 Sep 2021 11:57:15 +0200

[C language] Pointer -- the basic knowledge of pointer you must master

preface Pointer is the key and difficult point of C language. Mastering pointer skillfully can better understand the storage mode of calculation, simplify the code and enhance the efficiency of the program. 1, Pointer overview A pointer is a variable that holds the address (number) of the memory unit. Pointer creation When defi ...

Posted by coldfused on Sat, 25 Sep 2021 20:54:37 +0200