Wang shaodong's Blog
about-encoding
Back to Home
about-encoding
Created
2020-02-23
|
Updated
2020-02-23
|
Post Views:
Author:
wang shaodong
Link:
http://linuxmint17.github.io/2020/02/23/about-encoding/
Copyright Notice:
All articles on this blog are licensed under
CC BY-NC-SA 4.0
unless otherwise stated.
Previous
C++ VS c
C++ 曾经被叫做C With class, C++ 是兼容C的,并不是100%兼容 C++ 中的C子集是C++的一部分,C语言中允许的东西到C++中可能会不允许 全局变量初始化: C语言中只能使用 constant初始化全局变量 C++可以通过函数初始化123456789101112131415#include <stdio.h>int init(){ printf("inside init func\n"); return 100;}int global_int = init(); // 此语句cpp文件能够编译执行,c文件编译失败int main(){ printf("Hello world\n"); printf("global_int= %d\n", global_int); return 0;} C++的C子集 是更好的C,将C中的一些不严格的编译检查,变得相对更严格C++ 编译器编译之后函数的 mangling na...
Next
About preprocess
预处理是C/C++ 编译过程中的第一个环节, 处理以#开头的文本行 比如免费版和付费版的功能多少的条件编译 实现代码对于不同平台的兼容,或者对相同平台的不同版本进行兼容 宏的作用常见的就是简单的文本替换功能,实现函数的替换,DEBUG版本加打印,release 版本不加打印12345678910111213141516171819202122232425262728// 此代码来自 Learn C the hard way 一书#ifndef __dbg_h__#define __dbg_h__#include <stdio.h>#include <errno.h>#include <string.h>#ifdef NDEBUG#define debug(M, ...)#else#define debug(M, ...) fprintf(stderr, "DEBUG %s:%d: " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)#endif#define...
wang shaodong
Articles
83
Tags
15
Categories
0
Follow Me
Announcement
This is my Blog
Recent Posts
Contact ways
2026-06-13
Hexo Quick Manual
2023-01-24
kernel structs pos
2022-03-23
busybox SUID support
2022-03-23
kernel image formats
2022-03-23