Principle, use and implementation of intelligent pointer in C + +

Principle, use and implementation of intelligent pointer in C + + Transferred from: https://www.cnblogs.com/wxquare/p/4759020.html 1 function of smart pointer Using heap memory in C + + programming is a very frequent operation. The application and release of heap memory are managed by programmers themselves. Programmers can improve the effic ...

Added by henryhund on Tue, 04 Jan 2022 10:31:20 +0200

C + + design pattern - state pattern

State modeAllows an object to change its behavior when its internal state changes. Object appears to have modified its class-- Baidu EncyclopediaSimply put, state pattern is state machine design. It is mainly used for the same request to perform different functions under different conditions. Its function is equivalent to if else. significanceI ...

Added by atlanta on Tue, 04 Jan 2022 06:43:54 +0200

Tree array: 1D + 2D

Some content sources: bestsort blog Recommended blog: CSDN: Nangong Yichen - thoroughly understand the two-dimensional tree array CSDN: Lv1_kangdi - 2D tree array summary and template The one-dimensional tree array sum[x] records the prefix and length of lowbit(x) from 1 to X The two-dimensional tree array sum [x] [y] records the sum of area ...

Added by BooRadLey on Tue, 04 Jan 2022 06:41:27 +0200

Simple knowledge of bit operation

Simple knowledge of bit operation Several points to remember in bit operation are: If you want to go to the last place, use num% 2To remove the last bit, use num = num / 2If it is judged that a number is the power of 2, use (n & - n) = = n, which will be described in detail belowThe XOR of two identical numbers is 0, the XOR value of al ...

Added by desmortes on Tue, 04 Jan 2022 06:33:37 +0200

Data structure algorithm problem (C + +)

0 preparation Online C + + running tool How to use: copy the code in each question to the online running website above Chapter 1: sequential representation of linear tables 01 Title: suppose the sequence table is not empty. Find the minimum value and its subscript from the sequence table and return it by reference Idea: ① Application v ...

Added by BraniffNET on Tue, 04 Jan 2022 05:20:50 +0200

Program design - school sorting - 01 car club management system

1, Subject content and requirements 1. Problem description With the improvement of modern living standards, household cars have increasingly become a necessity in life. Learn about riders' information to facilitate communication and organize activities among riders. The system requires the development of a riders Club software, which can ...

Added by Lexi on Tue, 04 Jan 2022 04:02:41 +0200

Bubble spitting problem solution

Link: https://ac.nowcoder.com/acm/problem/15029?&headNav=acm Source: niuke.com Time limit: 1 second for C / C + + and 2 seconds for other languages Space limitation: C/C++ 32768K, other languages 65536K 64bit IO Format: %lld Title Description The little fish spit bubbles and come out. Small fish will spit out two kinds of bubbles: big bub ...

Added by linfidel on Mon, 03 Jan 2022 20:27:31 +0200

Dynamic memory management, file operation, preprocessing

Last Dynamic memory management Apply for memory by creating variables When memory is released depends on what kind of variable the variable is If it is a global variable, it will be released following the program If it is a static variable, it is also released with the program If it is a local variable, it is released following the code bl ...

Added by chaking on Mon, 03 Jan 2022 18:45:10 +0200

C++ 11. Function - (function, definition, call, value transfer, common function style, function declaration, function sub file writing)

catalogue Overview of functions: Functions: The function definition is divided into five steps: Function call: Value transfer: Common function styles: Declaration of function Function sub file writing Overview of functions: A large program is generally divided into several program blocks, and each module realizes specific functions ...

Added by Andy-H on Mon, 03 Jan 2022 17:39:50 +0200

Access control of C + + classes

Private and public There are methods and member variables in a class. After the public keyword is identified, the methods and variables under public become public functions. After the private keyword is identified, the methods and member variables under the private keyword become private. By default, if public is not declared, all methods and ...

Added by pck76 on Mon, 03 Jan 2022 17:22:25 +0200