Detailed explanation of C + + function overloading

Detailed explanation of C + + function overloading In actual development, sometimes we need to implement several functions with similar functions, but some details are different. For example, we want to exchange the values of two variables. These two variables have many types, such as int, float, char, bool, etc. we need to pass the address of ...

Added by Marsha on Wed, 02 Feb 2022 13:19:03 +0200

Basic tutorial for getting started with C + +: const qualifier and "reference"

Catalogue preface 1, const qualifier 2, Quote 1 definition of reference 2 reference as function parameter 3 reference function return value 4 nature of reference 5 constant reference Concluding remarks preface Through summarizing the basic knowledge of C + +, the blogger is expected to write a simple C + + basic tutorial column and ...

Added by ohaus on Wed, 02 Feb 2022 11:32:18 +0200

Notes on the fifth edition of c++primer: function pointer

p221 The type of a function is determined by its return type and formal parameter type, regardless of the function name. Take chestnuts for example: bool lengthCompare(const string &,const string &) The type of this function is bool (const string &, const string &). To declare a pointer that can point to the function, sim ...

Added by lizzyd on Wed, 02 Feb 2022 07:59:05 +0200

C + + smart pointer unique_ptr

Today, let's talk about class template unique_ptr. Before that, first answer the reader's question: what should I do in C language? There are several suggestions: When writing, try to follow the principle of application within the function and release within the functionNote that malloc and free are written in pairsUse static scanning tools, ...

Added by rjs on Wed, 02 Feb 2022 06:25:32 +0200

Detailed explanation of expression (csp-j 2021 expr)

First move the topic from the valley of Los Angeles Title Description Little C is keen on learning mathematical logic. One day, he found a special logical expression. In this logical expression, all operands are variables, and their values can only be , 0 , or , 1. The operation is carried out from left to right. If there are parentheses i ...

Added by mpb001 on Wed, 02 Feb 2022 06:04:53 +0200

C + + hand training project (simple HTTP webserver based on muduo network library + mysql+jsoncpp for web page display database background data)

Project introduction Project github: github link This project is based on C + + language, Mr. Chen Shuo's muduo network library, mysql database and json CPP. The server listens to two ports, one for processing http requests and the other for processing json data sent. This project cooperates with a qt+opencv license plate recognition front ...

Added by clarky08 on Wed, 02 Feb 2022 03:21:07 +0200

C + + foundation 4: array and string

catalogue 1, Array 1. First knowledge of array 2. Variable length array 3. Unknown array length 4. Reading and writing of array elements 5. Multidimensional array 6. Constant array 2, String 1. Array string 2. String length 3. Constant string 4. String operation and attribute acquisition 5.string class 1, Array 1. First knowledg ...

Added by angus930 on Wed, 02 Feb 2022 01:53:42 +0200

More Effective C + +, the implementation of C + + reference counting and copy on write

1. Reference count c + + reference counting can save memory and reduce the cost of building objects and destructors at the same time. The so-called reference counting simply means that each object shares an entity's data, but we need to realize the record of the object referenced to the data, so that the data can be safely deleted after th ...

Added by karnul on Wed, 02 Feb 2022 00:09:56 +0200

[C + +] [binary tree] [binary search tree] build a binary search tree class.

1, Key analysis 1. Insert node Inserting a node is relatively simple. You only need to judge the key value, replace the corresponding key value, or create a new key value. // Insert the node (key, value) into the binary search tree with node as the root, and use the recursive algorithm // Returns the root of the binary search tree ...

Added by dietkinnie on Tue, 01 Feb 2022 21:46:07 +0200

Learn about threads

I Thread concept In some cases, multiple control processes need to be executed simultaneously in one process. For example, to realize the download software of a graphical interface, on the one hand, it needs to interact with the user, wait for and process the user's mouse and keyboard events, on the other hand, it needs to download multiple fi ...

Added by pck76 on Tue, 01 Feb 2022 20:21:05 +0200