Chapter 15 object oriented programming (1 ~ 27)

C++ Primer Chinese Version (5th Edition) practice solution collection Write your own answers. If there are mistakes, please correct them in the comment area! 1 For some members, the base class wants its derived classes to customize their own versions (rather than directly inherit without change). At this time, the base class defines these ...

Posted by Blondy on Wed, 13 Oct 2021 06:09:44 -0700

C + + code learning 01

Article catalog prefaceI Experimental contentII code 1.CMatrix.h2.CComplex.h3.CMatrix.cpp4.CComplex.cpp5.main.cpp3, Testingsummary preface This article is mainly about the creation of two-dimensional matrix in C + + and the application of various operators to two-dimensional matrix. Tip: the following is the main content of t ...

Posted by OmarHaydoor on Wed, 13 Oct 2021 06:07:00 -0700

New feature of C++11: lambda expression

Lamda expression Lambda expressions in C++ 11 are used to define and create anonymous function objects to simplify programming. A complete Lambda expression is as follows: [=] (int x, int y) mutable -> int { int z = x + y; return z; } [Function object parameters] (Operator overloading function parameters) mutable or exception statement - ...

Posted by jeturman on Tue, 12 Oct 2021 18:44:31 -0700

Design and implementation of CMatrix class (the first experiment of C + +)

1. Constructor: 1.1 concept of constructor Compared with C language, C + + has a better feature is constructor, that is, a class controls the initialization process of its object through one or several special member functions. The task of the constructor is to initialize the data members of the object. Whenever the object of the class is ...

Posted by cristal777 on Tue, 12 Oct 2021 11:20:05 -0700

Recursive and Divide-and-conquer Strategy

Recursive and Divide-and-conquer Strategy 1. Recursion 1. Distinguish Recursion from Cycle Recursive: You open the door in front of you and see that there is still a door in the house. You walk over and find that the key in your hand can open it. You push open the door and find that there is still a door in it. You continue to open it. ...

Posted by adamking217 on Tue, 12 Oct 2021 09:59:22 -0700

(Beginner's introduction) "after learning opencv, mom won't worry that you won't be able to program images!" ~ learning and application of OpenCV image library programming

Practice compiling and installing the famous C/C + + image processing open source software library Opencv3.x under the Ubuntu 16 / 18 system. Preface (installation steps of opencv) Reference article: https://blog.csdn.net/forever_008/article/details/103625637 According to step by step, problems can be solved by Baidu Tip: opencv has ...

Posted by OriginalBoy on Mon, 11 Oct 2021 19:34:48 -0700

Using libpcap to capture packets under Linux

1. Background Learning PF_ During ring, it is found that libpcap is overloaded. So back to basics, I learned the pcap packet capturing principle again. 2. Relevant knowledge 2.1 principle This article is very clear< libpcap implementation mechanism and interface function> The packet capture mechanism implemented here is to add a b ...

Posted by Coreye on Mon, 11 Oct 2021 12:18:42 -0700

[advanced C language] playing with pointer -- High-level playing method of pointer!

preface We have already touched the topic of pointer in the chapter of pointer at the primary stage. We know the concept of pointer: 1. A pointer is a variable used to store an address, which uniquely identifies a piece of memory space. 2. The size of the pointer is fixed 4 / 8 bytes (32-bit platform / 64 bit platform). 3. The pointer i ...

Posted by jonat8 on Sun, 10 Oct 2021 06:44:18 -0700

Effective C + + learning notes 03

03: use const as much as possible 1:const modification of pointers and constants char greeting[]="Hello"; char* p=greeting; //non-const pointer, non-const data cons seven char* p=greeting; //non-const pointer, const data char* coast p=greeting; //const pointer, non-const data coast char* coast p=greet ...

Posted by Cereals on Sun, 10 Oct 2021 05:41:47 -0700

PTA linked list de duplication

56 line less than AC Idea: (look here! Look here! [original] it is troublesome to delete duplicate elements (move them to another array at the same time) and change the address of the data behind the original table. It is troublesome and time complexity is high. [now] one key point is that the next address of the data is not required. Change ...

Posted by sangamon on Sun, 10 Oct 2021 04:57:23 -0700