fork/vfork浅谈

In *UNIX, multi-process programming can be implemented using fork/vfork. Here is a summary of the relevant knowledge.

Read more »

main原型考证及程序终止行为

In C and C++, there are many versions of the main function prototype that circulate, and different books present different ways of writing it. Today, I will explore what constitutes “standard behavior” from the perspectives of several standards (C89/99/11 and C++98/03/11/14) and what happens after the main function returns.

Read more »

C和C++之间的不兼容

Previously, it has been mentioned several times that C and C++ are not the same language. Even the part inherited from C in C++ has significant differences from ISO C. I will gradually compile some of their incompatible features here.

Read more »

C++中declaration与define的区别

Many C++ books do not clearly state the difference between declaration and definition, or they only mention the need to support separate compilation, indicating that using the extern specifier is a declaration, while without it is a definition. In fact, I think the C++ standard describes the difference between declaration and definition more clearly.

Read more »

对象的构造和析构顺序

Through a CppQuiz question to describe the order of construction and destruction of C++ objects in the context of inheritance according to the C++14 standard, as well as throwing exceptions during object construction/destruction.

Read more »

重载(overload)和重写(override)

In C++, overload and override are not related, but they are easily confused due to the similarity of the terms.

Read more »

Linux上的Samba配置

Through Samba, we can mount folders from Linux to Windows. After deploying Samba on a Linux virtual machine, I can use the remote compilation plugin I wrote a few days ago (sublimeRemoteCompile) to write code on Windows! It’s quite enjoyable. Today, I will briefly record how to configure Samba sharing on the server for friends with similar needs.

Read more »

SublimeText的远程编译插件

Running some small test codes on Linux from Windows can be quite tedious, especially since I have to manually execute the compilation commands on Linux. Also, using Samba on my Raspberry Pi to share the code to Windows requires me to SSH and compile it manually, which is a waste of time.
These past few days, I wrote a small Sublime Text plugin during my free time to remotely compile C/C++ code on Windows, meaning that I write the code on Windows but it actually executes on Linux. I’ve only implemented the functionality for now, and I plan to optimize it during my break after the holidays.
The code is hosted on GitHub: sublimeRemoteCompile, using some C++11 features, and the compiler must be specified during compilation.

Read more »