I have a Raspberry Pi 2B+ that has been collecting dust for quite a while. Due to frequent power outages at school, I haven’t used it for running scripts or downloads. However, recently, the SSH connection to the VPS has been dropping due to power/network issues, which has been quite frustrating. So I’ve decided to turn the Raspberry Pi into a portable compiling environment.
Some misunderstandings about compiler-generated default constructors
When a class we write does not explicitly provide a constructor but the compiler needs a constructor
(be sure to note this phrase), the compiler will generate one for us. However, the default constructor generated by the compiler does not meet our expectations of what it can accomplish.
Operating system interprocess communication
The methods for achieving inter-process/thread communication include:
- Inter-process communication methods: file mapping, shared memory, anonymous pipes, named pipes, message slots, clipboard, dynamic data exchange, object linking and embedding, dynamic link libraries, remote procedure calls, etc.
- Thread synchronization methods: events, critical sections, mutexes, semaphores.
C++11 syntactic sugar
From C language to C++03, the OO features feel absolutely great. Recently, I focused on the new features of C++11 and found many fantastic syntactic sugars! It’s also very enjoyable to use.
Memory leak caused by STL releasing pointer elements
When we delete a pointer, the object it points to will be deleted. However, this does not happen when pointer objects are stored in an STL container.
Use Gprof to analyze code performance bottlenecks
Using profiler to analyze the performance of code is more efficient, detailed, and intuitive than pure cognitive analysis.
Detailed analysis of type conversion in C++
In C++, when the operand types of an operator are inconsistent, these operands will be converted to the same type. Type conversion is divided into implicit conversion and explicit conversion.
Summary of some object-oriented knowledge in C++
近期准备求职面试。
将C++中面向对象部分的基础知识复习整理一下。
Select member and non-member impl of operator-override
When designing classes to overload operators, it is essential to choose whether to implement the operator as a member or as a regular non-member function.