Explain the smart pointer in C + +

preface Four smart pointers in C + +: auto_ptr, unique_ptr,shared_ptr, weak_ptr, of which the last three are supported by C++11, and the first has been abandoned by C++11. Introduction to C++11 intelligent pointer Smart pointer is mainly used to manage the memory allocated on the heap. It encapsulates the ordinary pointer as a stack object. ...

Posted by kabucek1 on Mon, 23 May 2022 07:09:43 +0300

Real and complex matrices and their various operations implemented in C language

I. Introduction I recently worked as an intern in a company and spent three weeks working on an indoor positioning algorithm (rudimentary, not yet optimized) to realize the joint writing and debugging of matlab and C. The author believes that the difficulty lies in the various operations of the matrix. In C++ There is Eigen library available. E ...

Posted by manchuwok on Sun, 22 May 2022 14:49:52 +0300

C + + Runtime Type Identification (a new feature of C + +)

Compile time overhead When compiling code, the compiler mainly carries out lexical analysis (identifying words, confirming parts of speech: identifiers, keywords, strings, numbers, etc.), syntax analysis (identifying the grammatical attributes of phrases and sentence patterns, generating syntax trees), semantic analysis (confirming the semanti ...

Posted by Dillinger on Fri, 29 Apr 2022 00:43:23 +0300

C + + Notes - references, pointers and const

Reference, pointer and const 1, Reference (strictly speaking, this refers to "lvalue reference") Two rules: (1) When defining a reference, the program will always bind the reference to its initial value object (2) After a reference is bound to an object, it cannot be rebound to another object Rule (1), different from copy, changes one ...

Posted by adrianuk29 on Wed, 27 Apr 2022 00:03:50 +0300

[C language] C + + class implemented in C (taking String class as an example)

Introduction: process oriented C language is a relatively low-level high-level language, and C + +, c#, Java and Python are all object-oriented high-level languages, but C language is firmly at the top of the list of programming languages, which shows that C is widely used and powerful, as small as "Hello, wood!", Lighting the LED of ...

Posted by Twentyoneth on Wed, 06 Apr 2022 00:08:37 +0300

Data structure experiment report

Operation and experimental data structure of linked list (II) 1, Experimental purpose 1. Master the expression and implementation method of chain storage structure of linear list. 2. Master the algorithm implementation of the basic operation of the linked list. 2, Experimental content 1. Establish a single linked list, and implement inserti ...

Posted by brandye71 on Mon, 04 Apr 2022 10:02:11 +0300

Understand typedef in C language

(translation, with deletion and modification) 1. Definition and scope of typedef typedef allows us to create aliases for existing types or user-defined types. The format is: typedef <existing_names_of_datatype> <alias__userGiven_name>; Example: typedef int myint; myint is an alias for int. From this point on, we can use ...

Posted by powerpants on Sat, 26 Mar 2022 12:07:20 +0300