Memory management + function template and class template
The difference between global variables and global static variables: link attributes are different. globavar is visible in all files, while global static is only visible in this file. Relationship between malloc - > operator new - > New malloc new = malloc + failure throw exception; Throw exception (object-oriented way to handle errors) n ...
Posted by brash on Sun, 26 Sep 2021 21:33:51 +0200
Common features of C++ 11
12.Lambda expression
Lambda expression is one of the most important and commonly used features of C++11. It is a feature of modern programming languages. Lambda expression has a declarative programming style. 2. Simplicity, avoiding code expansion and function dispersion. 3. Features such as closure of functions in the time and place required. ...
Posted by rkeppert on Sun, 26 Sep 2021 18:38:24 +0200
[learn C together] dynamic memory allocation
Dynamic memory allocation
preface:
If you can open up memory at will and open it as you use it, can you make the use of memory more efficient? There will be no situation where more development can't be used up and less development can't be used up. Dynamic memory development solves this problem.
Open up location
Memory can be roughly divide ...
Posted by stuffradio on Sun, 26 Sep 2021 11:57:15 +0200
[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
Copy constructor, this pointer, assignment operator overload, complete class
Catalog
copy constructor
this pointer
Because this pointer points to its own object, we return this pointer to return our own object
Assignment Operator Overload (Assignment Constructor, have I forgotten this statement, I've always called it that way)
Complete class (parameterized, parameterized, copy, assignment, destructive)
copy con ...
Posted by srhino on Sat, 25 Sep 2021 19:04:03 +0200
C++ Review Notes: Classes and Objects
c++ online compilation tool for fast experimentation: https://www.dooccn.com/cpp/
1.Write before
During this period of time, I plan to pick up c++. One of the lessons I learned from my internship is that Algorithm Engineers solve practical problems, so they can't be limited by algorithms or projects. They should always improve their ability t ...
Posted by idweb on Sat, 25 Sep 2021 18:13:49 +0200
Learning notes of data structure, algorithm and application - C + + language description - competition tree
1, Winner tree
Suppose n players take part in a tennis match. The rule of the game is "sudden death": as long as a player loses a game, he will be eliminated. A pair of players play one-on-one, and finally only one player remains unbeaten. We use binary tree to describe the game process. Each external node represents a player, ea ...
Posted by excence on Sat, 25 Sep 2021 12:59:48 +0200
C language fgetc and fputc function usage details
When reading and writing a file as characters, you can read one character from the file or write one character to the file at a time. Two functions are mainly used: fgetc() and fputc().
Character reading function fgetc
Fgetc is the abbreviation of file get char, which means to read a character from the specified file. The usage of fge ...
Posted by bigbstanley on Fri, 24 Sep 2021 16:08:14 +0200
Dilworth theorem learning notes
Yesterday, you got dilworth theorem in t2 Middle School of membrane competition. I felt a little wonderful, so I simply studied it
1. Introduction: first review yesterday's film game t2
The main idea of the question is that given n tuples (x,y), the two tuples of X1 < = x2 and Y1 < = Y2 can be divided into one pile. How many piles c ...
Posted by alsal on Thu, 23 Sep 2021 14:18:17 +0200
C + + print files -- files and streams
Files and streams
Due to the needs of the project, it is required to output the image data to the file after processing. In the file, different kinds of data will be displayed in table layout. At first, it was not easy to do, and then try it
1. Basic knowledge
To process files in C + +, you must include header files and in the C + + source ...
Posted by scottb1 on Thu, 23 Sep 2021 09:12:41 +0200