C + + class constructor friend
C + + class notes
1, Class
The basic idea of class is abstraction and encapsulation. Class, including three parts:
Data member of classFunction body responsible for interface implementationDefine the various private functions required by the class
It should be noted that the declaration of member function must be inside the class, and its d ...
Added by xplosiongames on Thu, 20 Jan 2022 01:16:56 +0200
Essential C++ Chapter 7 learning record (exception handling)
Chapter 7 exception handling
Section 4.6 implementation of triangular_ When the iteratorclass, the iterator has potential errors, which may lead to the generation of error status.
class Triangular
{
friend class Triangular_iterator;
public:
static bool is_elem(int);
static void gen_elements(int length);
static void gen_elems_t ...
Added by Vern1271 on Wed, 19 Jan 2022 23:13:13 +0200
leetcode15. Sum of three (medium)
Give you an array num containing n integers. Judge whether there are three elements a, b and c in num, so that a + b + c = 0? Please find all triples with sum 0 and no repetition.
Note: the answer cannot contain duplicate triples.
Example 1: Input: num = [- 1,0,1,2, - 1, - 4] Output: [- 1, - 1,2], [- 1,0,1]]
Example 2: Input: num = [] Output ...
Added by XtacY on Wed, 19 Jan 2022 21:55:24 +0200
Summary of computer graphics experiment in Shandong University
preface
This paper is a summary of computer graphics experiments. The experiments are written in glad and glfw. There are still many imperfections in the code. For example, the operations of drawing lines and polygons can be reasonably encapsulated to form a perfect graphics header file and even namespace, which is very helpful to the foll ...
Added by thinkgfx on Wed, 19 Jan 2022 20:25:25 +0200
Notes on adding two numbers
Title Source: LeetCode
https://leetcode-cn.com/problems/add-two-numbers
Give you two non empty linked lists to represent two non negative integers. Each number is stored in reverse order, and each node can only store one digit.
Please add the two numbers and return a linked list representing sum in the same form.
You can assume that neither ...
Added by neiltaylormade on Wed, 19 Jan 2022 13:16:25 +0200
[C + +] STL Standard Template Library (Vector container - super detailed step-by-step example code explanation)
❥ it is mainly used for self review, plus experience exchange and sharing, one shift every day ❥
background
❀ a library is a collection of program components that can be reused in different programs. ANSI C + + includes a C++ STL (Standard Template Library), namely C + + Standard Template Library (c + + generic library). It defines commo ...
Added by bigMoosey on Wed, 19 Jan 2022 09:16:59 +0200
Relationship between const and reference.
1. Special Use of References
1 Basic Review
int main()
{
int a = 10;
const int b = 20;
//For integer a
int &c1 = a;
const int &c2 = a;
a = 2000; //You can modify the value of c2 through a
cout <<" a = "<< a << endl;
cout <<" c1 = "<<c1 << endl;
cout << ...
Added by DrTom on Wed, 19 Jan 2022 07:15:13 +0200
2022-1-14 Niuke C + + Project -- exec function family learning
Questions for review: 1. What is a function family? 2. What is the function of exec function family? 3. What will happen if exec is used in the parent process function? What better way? 4. execl function, execlp function
Function families are functions with the same or similar functions. Because there is no function overload in C language, fun ...
Added by burhankhan on Tue, 18 Jan 2022 20:37:17 +0200
Weekly test 1 (supplementary question) problem solution
Topic 1:
Title Description
Given the length of 4 ^ sticks, if there are 3 ^ sticks in them, they can form a TRIANGLE and output ^ TRIANGLE; If they cannot form triangles, but there are 3 ^ sticks in them, they can form degenerate triangles (the sum of any two sides is greater than or equal to the third side, but not triangles), output ...
Added by ams007 on Tue, 18 Jan 2022 17:43:51 +0200
1080 MOOC final score (25 points)
subject
For MOOC in Chinese Universities( http://www.icourse163.org/ )Students studying the "data structure" course who want to obtain a qualification certificate must first obtain an online programming homework score of no less than 200 points, and then obtain a total score of no less than 60 points (out of 100). The calculation for ...
Added by ggkfc on Tue, 18 Jan 2022 08:54:23 +0200