C + +: four types of cast

1, const_cast 1. The constant pointer is converted into a non constant pointer and still points to the original object; 2. Constant references are converted to non constant references and still point to the original object; 3,const_cast is generally used to modify pointers. Such as const char *p. #include<iostream> int main() { // ...

Added by Rollo Tamasi on Sun, 06 Mar 2022 03:15:49 +0200

[data structure] tree - Huffman tree (dynamic diagram, c + +, java, priority queue implementation Huffman tree)

GitHub sync update (Classified): Data_Structure_And_Algorithm-Review (it's best to give a star!!!) The following is the main body of this article, and the following cases can be used for reference. What is Huffman tree? Given N weights as N leaf nodes, a binary tree is constructed. If the weighted path length of the tree reaches the ...

Added by Prine on Sun, 06 Mar 2022 02:29:12 +0200

[data structure] talk about a new tree -- binary search tree

preface Binary search tree, also known as binary sort tree, is either an empty tree or a binary tree with the following properties: If its left subtree is not empty, the value of all nodes on the left subtree is less than that of the root nodeIf its right subtree is not empty, the value of all nodes on the right subtree is greater than that o ...

Added by MatthewBJones on Sun, 06 Mar 2022 01:09:08 +0200

Prepare for the Blue Bridge Cup--High Precision Algorithms for Multiplication and Division

💟 Author's introduction: Hello, my name is Ceylan_, Can call me CC ❣️ * 📝 Personal home page: Ceylan_ Blog 🏆 Blogger information: ordinary freshmen have extraordinary dreams Columns Prepare for the Blue Bridge Cup    Deduct one question per dayPTA Sky Ladder Race ⚡ I hope you can support me a lot 😘 Progress Together~ ❤️ 🌈 If it helps ...

Added by nickiehow on Sat, 05 Mar 2022 19:22:41 +0200

[Apollo 6.0] how does the cyber rt use the Reader to read the data sent by the Writer (underlying logic)

How does the Reader read the data of the Writer (underlying logic) Last Article (upper logic) The process of reading data by the reader is described in, but there is no bottom-level Tansport. This is how to conduct inter process communication. Let's analyze it here. In ReceiverManager::GetReceiver, call transport:: Transport:: instance() - &g ...

Added by skhale on Sat, 05 Mar 2022 17:38:28 +0200

Zombie process and daemon of Linux c/c + + process

1. Zombie process 1.1 definition of zombie process: The parent process creates a child process, and the parent process ends before the child process. If the resources of the child process are not released, it will become a zombie process and continue to occupy system resources 1.2 solutions to zombie process Before ending, the child proce ...

Added by DaPrince on Sat, 05 Mar 2022 17:22:58 +0200

A simple understanding summary of C++11's right value reference, mobile semantics and perfect forwarding

1 right value reference Function return procedure: The life cycle of a non static temporary variable in a function is at the end of the function call, so there will be a contradiction. It can be inferred how to return an object that will disappear when it comes out of the function body. When the function returns the object, it will make a ...

Added by uniflare on Sat, 05 Mar 2022 16:16:59 +0200

c++/java/go data structure and algorithm dynamic array

Original address Array Basic concepts It is a data structure composed of a collection of elements of the same type, which allocates a continuous piece of memory for storageThe storage address corresponding to the element can be calculated by using the index of the element Basic use of c + + array #include <iostream> #include <ve ...

Added by aleigh on Sat, 05 Mar 2022 16:02:10 +0200

Blue Bridge Cup training

Catalogue 1. 2. 3.  4.  5. 1. Title Description Before the popularization of electronic computers, people often used a rough method to check whether the four operations were correct. For example: 248 * 15 = 3720 Sum the multiplier and the multiplicand bit by bit respectively. If it is a multi digit number, sum it bit by bit until i ...

Added by jscruggs on Sat, 05 Mar 2022 14:40:00 +0200

C + + singleton mode and thread safety

C + + singleton mode and thread safety The simplest singleton mode can be // single thread safe version class Singleton { public: static Singleton* GetInstance(int x = 0) { if (instance_ == NULL) { instance_ = new Singleton(x); } return instance_; } void Print() { ...

Added by sheen.andola on Sat, 05 Mar 2022 11:48:04 +0200