Introduction to C + + Step03 [string and pointer]
Common string handling functions:
String concatenation function: (strcat) char * strcat (char destination[], const char source[]);
//Function: connect the string of parameter 2 to the end of the first parameter string
//Return value: the first address of the first string
//Note: ensure that the space length of parameter 1 is enough to store t ...
Posted by jannoy on Thu, 20 Jan 2022 06:31:06 +0100
C language string function summary
introduce
In the process of learning C language, the processing of strings is very frequent, but C language itself has no string type, so we need to use functions to facilitate our processing of strings.
● find the length of the string
strlen
● string function with unlimited length
strcpy
strcat
strcmp
● ...
Posted by rtown on Mon, 17 Jan 2022 15:41:33 +0100
C + + pointer
I like to specialize in the knowledge I love and the joy of completing the project come on. When your strength can't meet your goals, calm down and learn!
Pointer
Basic concept of pointer
Function of pointer: memory can be accessed indirectly through pointer
The memory number starts from 0 and is generally represented by hexadecimal d ...
Posted by python_q on Mon, 17 Jan 2022 08:05:48 +0100
Linked list sorting problem
Problem expression
problem analysis
The problem itself is easy to understand. Here are two solutions. The key to the problem of the linked list is to pay attention to the pointing between nodes. In addition, pay attention to each node, such as virtual head node, current node, previous node, next node, etc. the memory distribution of the li ...
Posted by phprocky on Sat, 15 Jan 2022 01:42:07 +0100
Dictionary tree (prefix tree)
Dictionary tree (prefix tree)
summary:
The dictionary tree (Trie) is used to determine whether a string exists or has a string prefix.
Why do we need a dictionary tree to solve this kind of problem? If we have a dictionary that stores nearly 10000 words, even if we use hash, the actual cost of searching for a word in it is very lar ...
Posted by raker7 on Sun, 02 Jan 2022 23:51:42 +0100
Simple analysis of C + + intelligent pointer
The meaning of smart pointer
In C + +, new and delete are the keywords to apply for and destroy heap memory. After applying for heap memory, programmers often forget to delete to release heap memory, which is easy to cause a phenomenon - memory leakage, that is, a piece of heap memory is not released after being applied, so that other programs ...
Posted by shmeeg on Sun, 02 Jan 2022 15:38:44 +0100
LeetCode brushing day 6 (string arrangement)
subject
Give you two strings s1 and s2 and write a function to determine whether s2 contains the arrangement of s1. In other words, one of the permutations of s1 is a substring of s2. Example 1:
Input: s1 = "ab" s2 = "eidbaooo"
Output: true
Explanation: s2 contain s1 One of the permutations of ("ba").
Example 2:
Input: s1= "ab" s2 = ...
Posted by jblack on Wed, 29 Dec 2021 08:45:06 +0100
9. Users establish their own data model
Defining and using structure variables
C language allows users to establish a combined data structure composed of different types of data, which is called structure Struct is the keyword that declares the structure type Declare the general form of a struct type: Struct structure name { Member table column } Declare each member: type name membe ...
Posted by gmcalp on Mon, 20 Dec 2021 03:47:37 +0100
Python_ Garbage collection mechanism
I Why do I need a garbage collection mechanism
When a Python program is running, it needs to open up a space in memory to store the temporary variables generated during running; After the calculation is completed, the result is output to the permanent memory. If the amount of data is too large and the memory space is mismanaged, it is easy to ...
Posted by elementz on Mon, 20 Dec 2021 00:09:51 +0100
[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