Address book management system (C + + basic summary case)

Reproduced in https://www.jianshu.com/p/d83623eb56dc 1, System functional requirements Add contact: add a new contact to the address book. The information includes (name, gender, age, contact number, home address) and records up to 1000 people Show contacts: displays all contact information in the address book Find contact: delete the specified ...

Posted by manitoon on Mon, 01 Nov 2021 21:41:13 -0700

C + + features ----- unique_ptr smart pointer

Background: in C + +, dynamic memory is usually managed through a pair of operators new, which allocate space for an object in dynamic memory and return the pointer of the object. You can choose to initialize the object; delete, accept the pointer of a dynamic object, destroy the object and free the memory associated with it. It is easy to have ...

Posted by mjm on Mon, 01 Nov 2021 21:14:24 -0700

json parsing C + + library nlohmann / json

Project address: nlohmann_json_cmake_fetchcontent/json.hpp at master · ArthurSonzogni/nlohmann_json_cmake_fetchcontent · GitHub design goal Intuitive syntax. In like Python In such a language, JSON is like a first-class data type. We used all the magic of modern C + + operators to achieve the same feeling in your code. Look at the fol ...

Posted by David03 on Mon, 01 Nov 2021 17:18:58 -0700

2 basic input / output stream (iostream)

Standard input and output objects The iostream class library defines four basic input / output objects cin: standard input, i.e. keyboard input cout: standard output, i.e. screen output cerr: handles standard errors, typically used to generate warning or error messages clog: generates the execution information of the program < < inserter ...

Posted by corillo181 on Mon, 01 Nov 2021 02:24:56 -0700

C + + inheritance and derivation

definition Class inheritance is a new class that obtains existing features from existing classes. Or the process of generating a new class from an existing class is the derivation of the class. The original class is called the base class or parent class, and the new class is called the derived class or child class. Derivation and inheritan ...

Posted by Browzer on Sun, 31 Oct 2021 21:16:04 -0700

[C language] super detailed explanation of string function & & memory function (detailed explanation + code demonstration + simulation implementation)

This article mainly introduces some commonly used string functions and memory operation functions. If there is a problem with what is written, please comment catalogue preface 1, strlen First, experience it through the following code   Function declaration The following error demonstration Simulation Implementation About const ...

Posted by dizzy1 on Sun, 31 Oct 2021 17:42:00 -0700

xmake v2.5.9 release, improves C++20 modules, and supports Nim, Keil MDK, and Unity Build

xmake Lua-based lightweight cross-platform construction tool, built with xmake.lua maintenance project, has a simpler and more intuitive configuration syntax than makefile/CMakeLists.txt, is very friendly to novices, can get started quickly in a short time, and enables users to focus more on the actual project development.In this release, we ha ...

Posted by levidyllan on Sun, 31 Oct 2021 12:54:13 -0700

Discussion on overload operator in structure

Discussion on overload operator in structure 1. Function of overloaded operator Use overloaded operators instead of member functions to complete a series of tasks for variables of structure type. Of course, we can use member functions to accomplish these tasks directly, but we can use them without overloading operators. Take an intuitive exam ...

Posted by Ulujain on Sun, 31 Oct 2021 12:34:04 -0700

Codeforces Round #751 (Div. 2)(A - C)

A.Two Subsequences Topic Essentials Give you a string s. You need to find two non-empty strings a and b to satisfy the following conditions: (1) Strings a and b are subsequences of s. (2) For each index i, the character s [i] in the string s must exactly belong to one of the strings a or b. (3) String a is the smallest possible dictionary ...

Posted by rash on Sun, 31 Oct 2021 11:33:25 -0700

System call I/O (file I/O)

File descriptor By opening a FILE with the open function, you can get a structure that stores all the attributes of the FILE (similar to the FILE of standard io), but not exactly like standard io. The open of system io will store the pointer of the structure in an array, and then return the subscript of the pointer in the array, but an int ...

Posted by FuzziNectar on Sun, 31 Oct 2021 09:40:35 -0700