C + + operators
1, Arithmetic operator
Unary operators (monocular) have the highest priority, followed by multiplication, division and remainder, and finally addition and subtraction. And it has left associativity, that is, when the priorities are the same, it is calculated from left to right.
Monocular: + or - (unary positive / negativ ...
Posted by q1234ask on Fri, 02 Sep 2022 21:39:06 +0300
1. Static
The static keyword can modify member variables and member methods
basic concept:
static member belongs to class It can be accessed through the class name, and is generally modified with public classname.propertyname; classname.methodname(); can also be accessed by object name (not recommended)
Memory explanation:
Sta ...
Posted by ess14 on Wed, 31 Aug 2022 03:28:19 +0300
A callback function is a function that is passed as a parameter. In C language, callback function can only be implemented by function pointer. In C + + language, you can also use imitative function or anonymous function. The use of callback function can greatly improve the efficiency of programming, which makes it widely used in modern programm ...
Posted by darkhappy on Mon, 22 Aug 2022 02:50:43 +0300
There is a basic principle that declaring a name in curly brackets restricts the visibility of the name to the scope of the curly brackets. However, enumerations declared in the C++98 style enum do not follow this principle. The visibility of these names extends to the scope containing the enumeration, meaning that the same name cannot be conta ...
summary
Today, this multi-school should be the best one to hit this summer vacation (although the ranking is not very high). My starting teammate found that the tree dp was signed in for question 1009. I thought about guessing an even-numbered side. I stared at my teammate and wrote A for ten minutes. Then we went to see 1003 again. After my t ...
Posted by thomasgrant on Thu, 18 Aug 2022 22:30:52 +0300
MNIST libtorch practical exercise
Ready to work
First download the MNIST database, http://yann.lecun.com/exdb/mnist/
After downloading, do not decompress it with software such as winrar. For example, t10k-images-idx3-ubyte is decompressed into t10k-images.idx3-ubyte. It is best to decompress it with tar in Linux environment.
Suppose you unzip t ...
Posted by chrys on Wed, 25 May 2022 15:51:55 +0300
copy constructor
We often use a variable to initialize a variable of the same type, so there should be similar operations for custom types, so how to use an existing object to create another same object when creating an object?
Constructor: There is only a single parameter, which is a reference to an object of this class type (usually cons ...
Posted by mad81 on Wed, 25 May 2022 10:40:27 +0300
1. Introduction
The basic concept of polymorphism and two simple examples based on polymorphism are introduced above. This paper will introduce the specific implementation principle of polymorphism and the use of constructor and destructor in polymorphism.
2. Implementation principle of polymorphism
The key to polymorphism is that when a vi ...
Posted by Bullit on Wed, 25 May 2022 10:28:08 +0300
Experiment 11: read / write the specified location information of the disk (just complete the reading)
1, Experimental purpose
(1) Knowledge of Disk Physics.
(2) Master the API for disk operation provided by Windows system.
(3) Read / write the specified sector according to the entered sector number.
2, Experimental preparation knowledge: intro ...