VSCode runs c++ program (operation + detailed explanation + json file configuration detailed explanation)

Preface: Because the quality of online tutorials varies, I felt very confused when I first came into contact with this thing. I hereby write this blog to help my friends solve the problem. Table of Contents 1. Operation details 1Download VSCode code editor 2Install C/C++ extension 3Install the MinGW-w64 compiler 4Add path 5 Test whether […]

“Data Structure, Algorithm and Application C++ Language Description” – Code to implement key-value ordered linked list jump list

Skip list Definition Searching in a dictionary of n number pairs described by an ordered linked list requires at most n key comparisons. If a pointer is added to the middle node of the linked list, the number of comparisons can be reduced to n/2 + 1. At this time, in order to find a […]

10. C++ operator overloading

1. Operator + overloading #include <iostream> #include <string.h> #include <unistd.h> using namespace std; class Point { private: int x; int y; public: Point() {} Point(int x, int y) : x(x), y(y) {} int getX(){ return x; } int getY(){ return y; } void setX(int x){ this->x = x; } void setY(int y){ this->y = y; […]

[C++ Breaking] Generic Programming | Function Templates | Class Templates

?Author homepage lovewold less r blog homepage Key points of this article: Explanation of basic knowledge points of c + + templates [C-C++ Getting Started Series Column]: Blog article column portal Word of the Day: Flowers bloom again, and people are no longer young Directory Preface Generic programming function template Function template concept Function template […]

Simulate the string class–[C++]

W…Y’s homepage Code repository sharing Foreword: We have already understood and mastered all the important interfaces of the string class in STL. In order to give us a deeper understanding of string and C++ classes and objects, our blog will simulate and implement the string class. Table of Contents Simulation implementation of string class Constructor […]

[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 […]

[C++]: Use of associative container map

Table of Contents 1. Introduction to map 2. Initialization of map 2.1. Method 1 2.2. Method 2 2.3. Method 3 3. Comparison of map sorting (functor) 4. Use of common built-in functions of map 4.1 Iterator 4.2 Capacity 4.3 Element access 3.4Modifier 3.5 Operation 5. Map traversal (iteration) 5.1 Iterator 5.2 Scope for Summarize 1. […]

vscode configuration c++ environment under mac

This article is reprinted from Using Clang in Visual Studio Code. In this tutorial, you will configure Visual Studio Code on macOS to use the Clang/LLVM compiler and debugger. After configuring VS Code, you will compile and debug a simple C++ program in VS Code. This tutorial will not teach you Clang or C++ languages. […]

Copying, assigning, cleaning and moving C++ objects

Copying, assigning, cleaning and moving objects MyString class Assignment and copying of objects /*Rectangular class*/ class Rectangle {<!– –> public: int length = 1; //length int width = 2; //width public: Rectangle() = default; Rectangle(int L, int W) :length{<!– –> L }, width{<!– –> W } {<!– –>}; void Print(void) const {<!– –> cout << […]