C language string function summary
introduce
In the process of learning C language, the processing of strings is very frequent, but C language itself has no string type, so we need to use functions to facilitate our processing of strings.
● find the length of the string
strlen
● string function with unlimited length
strcpy
strcat
strcmp
● ...
Posted by rtown on Mon, 17 Jan 2022 15:41:33 +0100
C + + smart pointer
brief introduction
C++11 smart pointer
preface
1, What is a smart pointer?
shared_ptr strong intelligent pointer, which can change the reference count of resources weak_ptr is a weak smart pointer and does not change the reference count of resources unique_ptr exclusive smart pointer, which can only be transferred and cannot be assign ...
Posted by bhavesh on Mon, 17 Jan 2022 15:21:26 +0100
muduo network library net source code line by line analysis_ one
1 muduo::net::EchoServer class reference
Collaboration diagram of EchoServer:
[legend]
Public member functionEchoServer (EventLoop *loop, const InetAddress &listenAddr)voidstart ()
Private member functionvoidonConnection (const TcpConnectionPtr &conn)voidonMessage (const TcpConnectionPtr &conn, Buffer *buf, Timestamp time)
Pr ...
Posted by timmy0320 on Mon, 17 Jan 2022 14:57:42 +0100
C + + pointer
I like to specialize in the knowledge I love and the joy of completing the project come on. When your strength can't meet your goals, calm down and learn!
Pointer
Basic concept of pointer
Function of pointer: memory can be accessed indirectly through pointer
The memory number starts from 0 and is generally represented by hexadecimal d ...
Posted by python_q on Mon, 17 Jan 2022 08:05:48 +0100
Chapter 21 of TCP/IP network programming
Understanding the asynchronous notification I/O model
Synchronous and asynchronous
The key of synchronization is the call and return time of function, as well as the start and completion time of data transmission.
Data transmission starts at the moment when the send function is called, and the data transmission is completed at the moment ...
Posted by Boxerman on Mon, 17 Jan 2022 07:31:07 +0100
C + + to achieve classic tank war
brief introduction
This project is based on easyX library to achieve a C + + version of the classic tank war game interface.
Download, installation and use of easyX Library
The full name of easyX is EasyX Graphics Library. It is a free drawing library for Visual C + +. It supports VC6 0 ~ vc2019, easy to use, low learning cost and wide appli ...
Posted by synted on Mon, 17 Jan 2022 03:44:11 +0100
Take your hand to tear the stack
Monotone stack
Is it time to use monotone stack
We must remember that the data structure must assist us in solving problems, and must be optimized in the way of violent solution (in fact, space for time)
The monotone stack must meet the first in first out feature when processing data, just as we must meet the first in first out feature w ...
Posted by mikosiko on Mon, 17 Jan 2022 03:16:09 +0100
Deep understanding of C + + smart pointer -- an analysis of MSVC source code
unique_ptr
unique_ptr is a move only type (move only type, std::mutex, etc.).
Combine the factory mode to see its basic usage, and give priority to std::make_unique : (for the factory mode, see my notes: https://zhuanlan.zhihu.com/p/423725151)
#include <iostream>
#include <memory>
class Animal
{
public:
virtual void Print( ...
Posted by Anxious on Mon, 17 Jan 2022 02:58:25 +0100
Object oriented programming -- functions and arrays
1, Purpose of the experiment:
Master the definition and use of functions; Master the method of function call; Master the mechanism of function parameter transfer; Master the use methods of global variables, local variables and static variables; Master the method of function overloading. Master the definition, reference and initialization of ...
Posted by Arab Prince on Mon, 17 Jan 2022 00:03:10 +0100
Sword finger Offer summary part II
Interview question 16: integer power of value Title: implement the function double power(double base,int exponent) to find the exponent power of the base. Library functions must not be used and large numbers do not need to be considered. Implement Pow function in C library function.
bool g_InvalidInput=false;
double power(double base,int expon ...
Posted by nivosh on Sun, 16 Jan 2022 20:44:37 +0100