STL associative container overview

Reference link Associative container While storing the element value, the associated container will be equipped with an additional value for each element (also known as "key", which is essentially an element of C + + basic data type or user-defined type). Its function is to find the target element directly through the key if the key ...

Added by joyser on Fri, 18 Feb 2022 07:05:38 +0200

A simple main function free main program framework class based on C + +

When teaching children to learn C + + language, in order to explain the encapsulation, inheritance and polymorphism of C + +, I wrote a simple main program framework class. The application only needs to derive subclasses from the main program framework class and implement its run(...) Method, and then define a subclass instance. The abstract c ...

Added by sysgenmedia on Fri, 18 Feb 2022 06:49:04 +0200

Explain const reference, constant pointer and pointer to constant in detail

Once the const object is created, its value cannot be changed, so the const variable must be initialized.As long as the value of const is not changed, const variable is the same as other variables const object in multiple files: By default, objects decorated with const are only valid in files. This means that allowing const variables with the ...

Added by Bourgeois on Fri, 18 Feb 2022 04:10:03 +0200

C + + concurrency and multithreading

1. Pass temporary object as thread parameter 1.1 pitfalls to avoid (explanation 1) First analyze the parameter i. The analysis shows that for i, the function in the thread originally uses reference transfer, but actually uses value transfer. Therefore, even if detach is used in the main thread to end the main thread first, the sub thread ...

Added by thinguy on Fri, 18 Feb 2022 02:21:01 +0200

Codeforces Round #719 (Div. 3) A - E problem solution

A. Do Not Be Distracted! Original title link: https://codeforces.ml/contest/1520/problem/A General idea of the topic If such as aaaaadddbbfgh, each letter appears only once continuously, then YES is output; otherwise, if such A as AABBA appears twice or more continuously in different positions, NO is output #include <iostream> # ...

Added by sargenle on Fri, 18 Feb 2022 00:01:43 +0200

Basic Algorithms Quick Sort, Merge Sort, Binary

[Algorithmic Basics Lesson] 1. Basic Algorithms (Top)] Quick Sort, Merge Sort, Binary 1. Basic Algorithms (Top) 1.1 Quick Sort step Determine the demarcation point: x = q[l] / x = q[(l + r) / 2] / x = q[r] / randomAdjust range: Recursive processing on left and right ends Template void quick_sort(int q[], int l, int r) { if ( ...

Added by bedrosamo on Thu, 17 Feb 2022 20:37:59 +0200

Dynamic memory management

Stack memory and heap memory The declared variables and function names are stack memory, but heap memory is used in dynamic memory management. Stack memory is relatively compact, so it has large local correlation. There is a dynamic expansion in the heap during operation, and the release needs to be displayed. new is called at run time. ve ...

Added by argan328 on Thu, 17 Feb 2022 20:12:06 +0200

Composite mode of C + + setting mode

Composite Pattern, also known as partial overall pattern, is used to treat a group of similar objects as a single object. The combination mode combines objects according to the tree structure, which is used to represent the partial and overall levels. This type of design pattern belongs to structural pattern, which creates a tree structure of o ...

Added by brodwilkinson on Thu, 17 Feb 2022 08:21:24 +0200

Overview of Cocos2d-x physics engine

Overview of Cocos2d-x physics engine   when we try to make a complex game, the game needs to simulate the situation of the real world, such as simulating the collision of two objects, simulating the object receiving gravity, etc. Do you need to use a physical engine   don't use a physics engine when your requirements are simple. Fo ...

Added by gooman on Thu, 17 Feb 2022 06:46:54 +0200

2022's wish: resist the pressure of C generation.

This article has written that as a person who is used to Python, there are some uncomfortable places and differences in some details in learning C + +. Of course, the most internal difficulties are related to the basis of C + +. Various writing methods of the same thing and mistakes that are easy to make accidentally are listed. Some simple th ...

Added by chadtimothy23 on Thu, 17 Feb 2022 02:39:38 +0200