C + +: introduction to operator overloading

preface 1. Operator overloading is a form of C + + polymorphism. 2. Overloading operators can make the code look more natural. Review class During normal class construction, some member methods may not need to be written. For example, in such a class representing time, the copy constructor is only a shallow copy, which is the same as the ...

Posted by lovelyvik293 on Wed, 10 Nov 2021 21:23:17 -0800

LeetCode brush notes linked list traversal linked list

160 intersecting linked list Given two linked lists, judge whether they intersect at a point, and find the intersection node. The input is two linked lists and the output is one node. If there are no intersecting nodes, an empty node is returned. Input: intersectVal = 8, listA = [4,1,8,4,5], listB = [5,0,1,8,4,5], skipA = 2, skipB = 3 Out ...

Posted by suvarthi on Wed, 10 Nov 2021 19:12:06 -0800

OpenCV basic tutorial (11) -- HighGUI graphical user interface

11. HighGUI graphical user interface 11.1 creation and use of slider 11.1,1 create slider: createTrackbar() function The createTrackbar function is used to create a slider with adjustable values: int cv::createTrackbar(const cv::String &trackbarname, const cv::String &winname, int *value, int count, cv::TrackbarCallback onChange = ( ...

Posted by ckjian on Wed, 10 Nov 2021 14:03:12 -0800

21 day good habit phase i-19

polymorphic What is polymorphism? Multiple forms and polymorphisms of the same thing in different scenarios can make the interface of functions universal. One of the three characteristics of object-oriented Advantages: clear code organization structure; Strong readability; It is conducive to early and later expansion and maintenance (based o ...

Posted by fmpros on Wed, 10 Nov 2021 08:24:33 -0800

Windows 10 Linux development environment building (WSL)

1, WSL initialization Search Linux from the Windows reference store and download Ubuntu (optional 18.04 or 20.04). After downloading, click Install from the start menu and you will be asked to initialize your user name and password. 2, Create root user Subsequent operations require root permission. Ubuntu does not have root user by default and ...

Posted by Yippee on Tue, 09 Nov 2021 22:48:12 -0800

Learning notes of Effective C + + (Clause 18: make the interface easy to be used correctly and not easy to be misused)

Recently, I started to watch Effective C + +. In order to facilitate future review, I specially took notes. If I misunderstand the knowledge points in the book, please correct!!! Three rules must be observed when designing a good interface: We must consider what kind of errors the user may makeThe interface should be designed consistentlyDon' ...

Posted by yacaph on Tue, 09 Nov 2021 13:39:28 -0800

Introduction to C + + novice-4

## Introduction to C + + novice -- 4 C + + storage class C + + storage class: defines the range and life cycle of variables / functions in C + + programs include: autoregisterstaticexternmutablethread_local Didn't look at it in detail C + + operator Arithmetic operator +,-,*,/,%,++,– Relational operator ==,!=,>,<,> ...

Posted by pasychosheep on Tue, 09 Nov 2021 10:21:54 -0800

boost::process Porting Notes

Recently, I wanted to be a process manager, because I was learning boost during this time, so I chose boost::process, but after a while I found that the compilation error under VC2010. The reason is that many C++11 grammars are used in process, and 2010 support is incomplete. So, here are the transplant notes. Don't tell me that VC2019 ca ...

Posted by woocha on Tue, 09 Nov 2021 08:12:48 -0800

Niuke challenge 48 E Speed Forwarding (tree over tree)

Link: E-speed forwarding_ Niuke challenge 48 (nowcoder.com) The given length is n n Sequence of n a a a. Altogether m ...

Posted by somenoise on Tue, 09 Nov 2021 03:55:05 -0800

Data structure experiment

1. Experimental topic      Graph is a widely used data structure, which is also the focus of this course. It is characterized by nonlinearity. The cross linked list storage structure of sparse matrix is also a storage structure of graph, so they are also included in this practice. This chapter continues to highlight the pro ...

Posted by Ruiser on Mon, 08 Nov 2021 15:33:12 -0800