Deep understanding of pointers

Deep understanding of pointers preface First, let's understand the concept of the following pointers: A pointer is a variable used to store an address, which identifies a piece of memory space.The size of the pointer is fixed at 4 or 8 bytes (32 or 64 bits).Pointers are typed, which determines the step size of pointer operation and t ...

Added by MrBillybob on Tue, 18 Jan 2022 08:36:53 +0200

2. Construction / deconstruction / assignment operation

Clause 05: understand which functions are written and called by default in C + + When you don't write it yourself, the compiler will create default constructor, destructor, copy constructor and copy assignment operator for your class by default. For example: class Empty{}; In fact, it's equivalent to class Empty{ public: Empty(){...} //d ...

Added by eelmitchell on Tue, 18 Jan 2022 08:02:10 +0200

[daily force deduction 24] merge two ordered linked lists

1, Title [LeetCode-21] Merge the two ascending linked lists into a new} ascending linked list and return. The new linked list is composed of all nodes of a given two linked lists.   Example 1: Input: l1 = [1,2,4], l2 = [1,3,4] Output: [1,1,2,3,4,4] Example 2: Input: l1 = [], l2 = [] Output: [] Example 3: Input: l ...

Added by sushiX on Tue, 18 Jan 2022 02:44:20 +0200

C++ Primer - Chapter 16 Templates and Generic Programming Notes

Chapter 16 Templates and Generic Programming Define Template Function Template template<typename T> int compare(const T &v1, const T &v2) { if(v1 < v2) return -1; if(v2 < v1) return 1; return 0; } Template definitions start with the keyword template followed by a list of template paramete ...

Added by yogibear333 on Tue, 18 Jan 2022 01:50:43 +0200

Algorithm exercise 6 --- Blue Bridge Cup 2017 provincial competition "pressure calculation"

preface Blue Bridge Cup group B 2017 provincial competition blank filling question (C + +) 1, Title Description A batch of precious metal raw materials are neatly stacked in the high-tech laboratory of Planet X. The shape and size of each metal raw material are exactly the same, but the weight is different. Metal materials are strictl ...

Added by enormousrodent on Tue, 18 Jan 2022 00:53:06 +0200

Multi-threaded operation of log files on Linux

1. Learning goals and plans? 2. Learning vi, grep awk, sed and some Linux commands 1. grep: Searches for files in the specified directory and manipulates the results, suitable for simply finding matching text 1.grep after test.log > res.log: in test. Find the row with the after keyword in the log and save it in res.log 2.find-name'* ...

Added by dougp23 on Tue, 18 Jan 2022 00:28:35 +0200

c + + learning notes - IO, sequential containers, and associative containers

IO File mode in: read when opening a file; out: write when opening a file (empty the file stream existing in the cloud by default); app: find the end of the file before each write (the current file data will not be cleared); ate: locate the file at the end of the file immediately after opening the file; trunc: empty the existing file stream wh ...

Added by Romeo20 on Mon, 17 Jan 2022 22:50:32 +0200

Compiling process of C/C + + program

preface How does C/C + + code become a program that can run on hardware? Let's start with a simple "Hello World" program. Hello World compilation There is a popular joke: A programmer was very interested in calligraphy and decided to make achievements in this field after retirement. So he spent a lot of money to buy the first-clas ...

Added by catreya on Mon, 17 Jan 2022 22:20:27 +0200

leetcode question brushing / hash table 438 Find all alphabetic words in the string

438. Find all letter words in the string Meaning: Given two strings S and p, find the substrings of all ectopic words of p in s, and return the starting indexes of these substrings. The order in which answers are output is not considered. Ectopic words refer to strings with the same letters but arranged differently. Example 1: input: ...

Added by landonmkelsey on Mon, 17 Jan 2022 21:24:11 +0200

shell concise tutorial

**Read only variable * * readonly var **Delete variable * * unset var Variable type: Local variables are defined in scripts or commands and are only valid in the current shell instance Environment variable a variable that can be accessed by all programs Shell variable is a variable specially set by the shell program Single quotatio ...

Added by partypete on Mon, 17 Jan 2022 19:21:45 +0200