[Elementary C++] Classes and Objects (3)

Directory 1. Let’s talk about the constructor again 1.1 Initialization list 1.1.1 How to write the initialization list 1.1.2 Which members should use the initialization list? 1.2 Characteristics of initialization list 1.2.1 Solving queue problems 1.2.2 The declaration order is the order of the initialization list 1.3 explicit keyword 1.3.1 The role of explicit keyword […]

Elementary C++–Classes and Objects (3) (Illustration)

Article directory Let’s talk about the constructor again initialization list implicit type conversion explicit keyword static member Friend class inner class anonymous object Some optimizations when copying functions Let’s talk about the constructor again In our previous constructor, the compiler will give a suitable initial value to each member of the object through the constructor, […]

[Elementary C Language] Function

Table of Contents 1. What is a function? 2. Classification of functions in C language 2.1 Library functions: strcpy memset 2.2 Custom functions 3. Function parameters 3.1 Actual parameters (actual parameters) 3.2 Formal parameters (formal parameters) 4. Function call 4.1 Call by value 4.2 Call by address 5. Nested calls and chained access of functions […]

Elementary C++ – Classes and Objects – Implementation of const members and date classes

Article directory const member Implementation of a date class Source code parse Constructor verification Operator reuse Prefix + + and postfix + + Validation of other operators const members The const modified member function is called a const member function. In a member function, the object pointed to by this pointer is hidden, and there […]

Elementary level of C language – function

1. Concept of function When we mention functions, we immediately think of learning functions in mathematics, such as: y=kx + b. But functions in C language are different from those in mathematics. Wikipedia defines C language functions like this: function, also known as subroutine. A portion of code in a large program, consisting of one […]

Data Structure [Elementary]–Sequence List

Table of Contents 1. The concept of linear table 2. Sequence table (1) Concept (2)Classification 1. Static sequence table (use fixed-length array to store elements) 2. Dynamic sequence table (using dynamically opened arrays to store data) (3)Interface implementation 1.Initialization sequence table 2. Destruction sequence table 3. Sequence table capacity check 4. Insert data using sequential […]

[Elementary C++]–Initialization list&static members&friends&inner classes&anonymous objects

================================================ ========================== Click to go directly to the personal homepage: Xiaobai is not a program Yuan C++ series column: C++ headache Code repository: Gitee ================================================ ========================== Table of Contents Preface Let’s talk about the constructor again initialization list explicit keyword anonymous object static member friends friend function Friend class inner class Understand classes and objects […]

Data Structure [Elementary]–Time Complexity and Space Complexity

Table of Contents I. Introduction 1. What is a data structure? (1) Concept 2. What is an algorithm? 1. Concept 2. Time complexity and space complexity of the algorithm 1. Algorithm efficiency (1)Complexity of algorithm 2. Time complexity (1) Concept (2) Big O asymptotic representation (3) Common time complexity calculation examples ① Calculate the time […]

[Elementary C++ (3)] Reference & inline function & auto keyword

Table of Contents Preface 1. Quote 1.1 The concept of citation 1.2 Characteristics of references 1.3 Permission to quote 1.4 Use of references 1.5 The difference between references and pointers 2. Inline functions 2.1 What is an inline function? 2.2 Characteristics of inline functions 3. auto keyword 3.1 auto introduction 3.2 Auto usage rules 3.3 […]