long在Windows64位上是4字节,在Linux和MacOS下是8字节。如下表所示系统位数sizeof longWindows324Windows644Linux324Linux648MacOS324MacOS648需要跨平台开...
1. 引言以localtime函数为例,有如下代码:#include <iostream>
#include <time.h>
int main() {
time_t start = time(NUL...
1. 引言Linux平台下,如下代码// main.cpp
#include <atomic>
#include <iostream>
int main() {
std::atomic_int val...
0. 准备编译目录新建目录D:\dev\opensource,所有编译过程均在该目录下进行。1. 编译zlib官网:https://zlib.net版本:1.2.131.1 下载源码下载后解压到D:\dev\opensource目录下...
0. 准备编译目录新建目录~/dev/compile,所有编译过程均在该目录下进行。mkdir -p ~/dev/compile
cd ~/dev/compile1. 编译zlib官网:https://zlib.net版本:1.2.1...
个人进行C++开发时会遵守的规范。参考了Google C++ Style Guide.1. 头文件1.1 #define保护所有头文件都使用#define...