C transition C + + Foundation (more detailed)

catalogue preface 1, The difference between C language and C + + 2, Input and output 1. Transplantation of C standard library 2.C + + standard input / output stream 3, Reference variable 4, Difference between functions ​ 5, User defined type 6, Dynamic memory allocation 7, Student achievement analysis Insert a message this pointer ...

Posted by chrispos on Fri, 05 Nov 2021 10:44:19 -0700

Principle of debugger

Software breakpoint int3 instructionThe machine code is 1 byte, i.e. 0xCCNo quantity limitlimitations It belongs to a code type breakpoint, that is, it can stop the CPU when it executes to an address in the code segment. It is not applicable to the data segment and I/O spaceFor programs executed in ROM (read only memory) (such as BIOS or othe ...

Posted by trixiesirisheyes on Fri, 05 Nov 2021 10:34:28 -0700

String matching in algorithm

28 implementation str () Determines whether a string is a substring of another string and returns its position. Enter a parent string and a substring, and output an integer indicating the position of the substring in the parent string. If it does not exist, return - 1. Input: haystack = "hello", need = "ll" Output: 2 ...

Posted by jlpulido on Thu, 04 Nov 2021 21:04:14 -0700

The performance of a murder case caused by an instruction optimization is crazy by 50%. Lang becomes stupid after using the - ffast math option

https://www.cnblogs.com/bbqzsl/p/15510377.html Recently, during optimization, some functions were bench tested on different compilation platforms . Found a lot of problems. Now let's share one of the questions. 1 typedef float MAFloat; 2 3 MAFloat sma(const MAFloat* seq, const int cnt, const int N, const int M) 4 { 5 const MAFloat C ...

Posted by LordPsyan on Thu, 04 Nov 2021 06:24:53 -0700

2021-11-04 swipe questions and punch in every day

2021-11-04 swipe questions and punch in every day Force buckle - binary tree 102. Sequence traversal of binary tree and Sword finger Offer 32 - II. Print binary tree II from top to bottom To give you a binary tree, please return the node values obtained by traversing in sequence. (that is, access all nodes from left to right layer by layer). ...

Posted by juschillinnow on Wed, 03 Nov 2021 23:38:50 -0700

C + + classes and objects

A change of blogger (thanks for reading): at first, blogging was just a whim. It was just to help review the knowledge points. I'm glad that my blog can be liked by everyone. However, recently, I deeply feel that writing a long blog is really too tired, and I have received a lot of feedback from fans during this period. It is suggested to pick ...

Posted by FrOzeN on Wed, 03 Nov 2021 23:23:47 -0700

[C language] files can be operated like this (code demonstration + detailed explanation + application)

This blog shares with you the knowledge about the operation of C language files, exchanges with each other and makes common progress What is a file? The code we wrote earlier uses "variables", or memory Memory characteristics Small capacity, speed block, data loss after power failure, relatively expensive But memory can't ...

Posted by jcantrell on Wed, 03 Nov 2021 23:10:45 -0700

A preliminary understanding of greedy thought

catalogue 1. Distribution issues 2. Interval problem 3. The best time to buy stocks 4. Summary 1. Distribution issues Title Description: This kind of problem probably means that there are a group of children and a pile of biscuits. Each child is very hungry. If the size of the biscuit is greater than or equal to the child's hunger, ...

Posted by DfyAnt on Wed, 03 Nov 2021 20:54:24 -0700

Named shared memory for Windows interprocess communication

summary    named shared memory mainly uses several API functions provided by windows to create, open, read and destroy named shared memory. Shared memory is more suitable for scenarios with message servers and message consumers. Its advantages are high efficiency and suitable for sharing more information. Its disadvantages are th ...

Posted by taldos on Wed, 03 Nov 2021 02:00:00 -0700

751-C + + design pattern - singleton pattern

Design pattern concept In brief, the design pattern means that when solving a certain kind of problem scenario, there is an established and excellent code framework that can be used directly. Compared with the problem-solving method we have found out ourselves, it has the following advantages: 1. The code is easier to maintain, and the readabi ...

Posted by biffta on Tue, 02 Nov 2021 08:53:12 -0700