C + + Learning -- templates and template classes
catalogue
1: Template function
one point one General template function
1.2 specialized template function
2: Template class
2.1 formwork
2.2 member template function
2.3 formwork specialization
2.3.1 template member function specialization
2.3.2 template specialization
3: Template class AutoPtr
1: Template ...
Posted by kaeserea on Tue, 16 Nov 2021 07:12:03 -0800
Constructor and destructor of single inheritance derived class
#include <iostream>
#include <cstdio>
#include <cmath>
#include <climits>
#include <iomanip>
#include <windows.h>//
#include <iostream>
#define MAX(x,y) (x)>(y)?(x):(y)
#include <string.h>
using namespace std;
class A
{
public:
A()
{
a=0;
co ...
Posted by blackwidow on Tue, 16 Nov 2021 05:17:43 -0800
C + + learning notes - deep copy and shallow copy
Note: the coding tool is CLion+Cygwin64
catalogue
copy constructor
assignment
Function return object
Object is passed as a function parameter
Shallow copy
Deep copy
copy constructor
When C + + assigns a value to an object reference, returns an object from a function, or passes an object as a function p ...
Posted by rajivgonsalves on Fri, 12 Nov 2021 19:50:48 -0800
Do you think it's easy to have two days apart?
These two days of love Anniversaries are approaching, I want to write a program to calculate the number of days that any two dates are directly separated by, think about it, the input is two dates, the output is a number of days problem, should be simple, the result is to change to a state of mind collapse, of course, this topic is not difficul ...
Posted by duncanwilkie on Fri, 12 Nov 2021 15:10:16 -0800
2048 - third draft of specific function realization [add new number]
2048 game - Implementation of specific functions third draft [add new number]
(updating...) Reference blog: https://blog.csdn.net/qq_39151563/article/details/104283217 Because it is too long to put in one article, it is divided into several parts.(there may be 10 articles =. =) Previous articles:2048 game series - Overview 2048 game series ...
Posted by jmut on Fri, 12 Nov 2021 03:28:24 -0800
800-C++ throw (throw exception) detailed explanation
Detailed explanation of C++ throw
Throw( Throw)--> Detection( Try) --> Capture( Catch)
Exceptions must be explicitly thrown before they can be detected and caught; if they are not explicitly thrown, even exceptions cannot be detected.
In C + +, we use the throw keyword to explicitly throw an exception. Its usage is:
throw exceptionDa ...
Posted by Mucello on Fri, 12 Nov 2021 02:04:14 -0800
C + + Abstract container type I (vector, list)
1, Container
When you first understand containers, you can think of containers as libraries that provide a series of specific functions.
2, Common containers
STL Classification of standard template library:
Sequence container:
vector: Vector container
list : List container
deque : Dual ended queue ...
Posted by herschen on Thu, 11 Nov 2021 10:27:33 -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
Tell a Romantic Love Story with Face-to-Face Mode for a Great Wedding
Design Mode Notes - Face Mode
Facade Design Mode
Basic Introduction
The facade design mode is a structural mode. Generally speaking, it refers to the surface of a building, especially the most attractive one. It can represent a behavior and appearance that easily misleads one's true feelings or situations. When people pass through the surfac ...
Posted by geekette on Thu, 11 Nov 2021 09:09:02 -0800
PAT (Basic Level) Practice (Chinese) 1058 multiple choice questions (20 points) PAT Level B
PAT (Basic Level) Practice (Chinese) 1058 multiple choice questions (20 points)
Title Description
It is more troublesome to correct multiple-choice questions. This topic asks you to write a program to help the teacher correct multiple-choice questions and to point out which one has the most errors.
Input Format
The input gives two positiv ...
Posted by mumford on Thu, 11 Nov 2021 08:19:53 -0800