Detailed explanation of smart pointer

unique_ptr is one of the smart pointers provided by C++ 11 to prevent memory leakage. It is a smart pointer that exclusively enjoys the ownership of the managed object pointer. unique_ The PTR object wraps a raw pointer and is responsible for its life cycle. When the object is destroyed, the associated original pointer is deleted in its destruc ...

Posted by mkohan on Mon, 06 Dec 2021 15:41:32 -0800

Pointer and array 1

Let's take a look at such an example. There is an operation of pointer to refer to array //Enter ten numbers and output from large to small #include<stdio.h> void sort(int x[],int n); int main(void){ int i,*p,a[10]; p=a; //Get address for(i=0;i<10;i++) scanf("%d",p++);//Continuous input p=a; //Fetch ad ...

Posted by smilesmita on Wed, 01 Dec 2021 20:20:15 -0800

Bidirectional circular linked list of leading nodes (C language)

Concept: bidirectional linked list is that each node has a precursor pointer in addition to the subsequent pointer. and Single linked list Similarly, the two-way linked list also has the structure of the leading node and the structure of the non leading node. The two-way linked list of the leading node is more commonly used; In addition, the tw ...

Posted by Pethlehemm on Mon, 29 Nov 2021 03:06:36 -0800

Explain multithreading and multiprocessing in detail. After reading it, you will understand

What are Python's support modules for concurrent programming? Module nameeffectthreadingRealize multithreading, and make use of the principle that the computer CPU and IO can execute at the same time, so that the CPU can access another task during the computer IO operation.multprocessingmultprocessingasyncioRealize asynchronous IO, and realize ...

Posted by gillypogi on Sun, 28 Nov 2021 07:02:26 -0800

C #- notes - from 0-1

Shortcut keys and Basics Note: //Single line note /Multiline comment/ ///Snippet comments /Carriage return of r/n win system output Ctrl+k+d quick alignment Ctrl+k+c quick comment Ctrl+k+u quick uncomment @Function 1. Cancel the meaning drilling function of \ in the string 2. Output the string in the original format. Example: Console.WriteLi ...

Posted by businessman332211 on Thu, 18 Nov 2021 19:49:52 -0800

C language beginners project 200 lines of code, using a two-dimensional array to realize the snake game

C language beginner project: a two-dimensional array to realize the greedy Snake game This article is for c Language beginners, so I try to use the most basic syntax to realize the whole game, and only use a two-dimensional array. The implementation process will be explained in detail below. A two-dimensional array can be directly printed into ...

Posted by Zeekar on Tue, 16 Nov 2021 08:38:38 -0800

C + + data or file compression and decompression reduction program based on ZLIB compression library

Project display Project development Compilation settings 1. Compilation settings in debug / release compilation mode First, open the property page of the project, and then select SDK and platform toolset as your current SDK and platform toolset. For example, I am SDK 10 platform toolset v141. Then, expand "C/C + +", cl ...

Posted by DevilsAdvocate on Thu, 11 Nov 2021 09:56:12 -0800

Simple implementation of Sanzi chess

First release the whole game source code, followed by the corresponding description, and the output result is at the end 1, Project 1.game.h about game related function declarations, symbol declarations and header files #Include < stdio. H > / / include header file #Include < stdlib. H > / / include of rand function header file # ...

Posted by zoidberg on Sat, 06 Nov 2021 22:12:11 -0700

Experience of using doctest

        There are many unit testing frameworks, and it is convenient for ubuntu to use gtest. The window s platform is mainly developed using vs2017. I use VS to develop qt projects. Although there are many fewer unit testing configurations with VS, I still need to import. props files. During testing, I need to change the a ...

Posted by juma929 on Sun, 26 Sep 2021 18:13:53 -0700