Common errors in C + + programs_ one
Today, I summarized some common errors in C + + programs, which we should try our best to avoid
1. Operation sequence error
Let's look at a procedure for judging odd and even numbers:
#include <stdio.h>
int main(int argc, char** argv) {
int n = 0;
printf("Input a natural number:\n");
while (1 == scanf("%d", &n)) {
if (1 & ...
Posted by spivey on Sat, 27 Nov 2021 15:00:58 -0800
C++ experiment_ 4:STL Application
Experimental Background
The full name of STL is Standard Template Library. STL involves many aspects, including but not limited to containers, iterators, algorithms, and function objects. This blog only introduces the most intuitive content of STL, involving principles and deeper concepts. You need to look for your own materials to learn. ...
Posted by jacomus on Sat, 27 Nov 2021 10:45:53 -0800
Request page storage management basic replacement algorithm LRU and CLOCK
1, Experimental purpose
By simulating several basic page replacement algorithms for request page storage management, understand the characteristics of virtual storage technology, master the basic ideas and implementation process of several basic page replacement algorithms in virtual storage request page storage management, and compare their e ...
Posted by fortnox007 on Fri, 26 Nov 2021 16:03:13 -0800
OLED rolling display and temperature and humidity detection
1, I2C introduction
1. IC2 introduction
I2C communication protocol (Inter Integrated Circuit) is developed by Phiilps company. It has the advantages of few pins, simple hardware implementation, strong scalability and no need for external transceiver equipment of USART, CAN and other communication protocols.
The connection mode of I2C on ...
Posted by ray-solomon on Fri, 26 Nov 2021 14:34:46 -0800
[LeetCode learning plan] algorithm introduction C + + day 7 breadth first search / depth first search
733. Image rendering
LeetCode
simple
single
\color{#00AF9B} {simple}
simple
There is a picture represented by a two-dimensional integer array. Each integer represents the pixel valu ...
Posted by Boo-urns on Fri, 26 Nov 2021 04:24:07 -0800
VS2015+Qt5.7.0+PCL1.8.1+VTK8.0 environment configuration steps
Congratulations on finding this article.
In my recent work, I need to use QT to write many functions about point cloud processing. There are too many pits in this process. (unable to resist the temptation to make complaints about PCL+VTK, the direct pop-up display of the point cloud is very simple. However, embedding VTK into Qt to display ...
Posted by killfall on Thu, 25 Nov 2021 19:13:57 -0800
Linux system programming - file IO
man has nine volumes. System programming is the content of Volume II, and volume V is file format and specification
open function
Function prototype
Parameter pathname file name
Macro with parameter flags as access mode: o_ Rdonly (read only), O_ Wronly, O_ Rdwr (read write) these three must be added
O_ Append, O_ Creat, O_ Excl ...
Posted by OriginalBoy on Thu, 25 Nov 2021 17:04:16 -0800
Application of STL Library
STL Standard Library for C++ Initial Knowledge
STL is an abbreviation for Standard Template Library, translated in Chinese as "Standard Template Library". STL is part of the C++ Standard Library.
Previously, we had a basic understanding of the template templet in C++ and the role of templates. It can be said that C++STL is a pow ...
Posted by GYK on Thu, 25 Nov 2021 09:10:42 -0800
New Features of C++11 Language
1. nullptr and std::nullptr_t
C++11 allows you to use nullptr instead of 0 or NULL
This new feature especially helps you avoid misunderstandings when "NULL pointer is interpreted as an integer value"
nullptr is a new keyword that is automatically converted to various pointer types but will not be converted to any integer type
For ex ...
Posted by hypernol on Wed, 24 Nov 2021 12:44:13 -0800
About process control
Process control
Create process
fork
//Create child process
pid_t fork(void);
//Success: the parent process returns the PID of the child process, and the child process returns 0; Failure: Return - 1, set errno value
The parent-child process who preempts the CPU time slice will execute first
Global variables cannot be shared between p ...
Posted by kapishi on Wed, 24 Nov 2021 11:54:04 -0800