Linux内核代码中使用的一种初始化数组的方法头文件中定义数组中的内容,如果__AR未定义,则将其定义为空 12345678/* 头文件 array.h */#ifndef __AR#define __AR(x, y)#endif__AR(1, -1)__AR(2, -2)__AR(3, -3) 初 ...
Read more »

什么是Coredump当程序运行的过程中异常终止或崩溃,操作系统会将程序当时的内存状态记录下来,保存在一个文件中,这种行为就叫做Core Dump(中文有的翻译成“核心转储)。 Coredump产生原因1. 内存访问越界 2. 多线程程序使用了线程不安全的函数 3. 多线程读写的数据未加锁保护 4. ...
Read more »

Some VIM commands! Vim is case sensitive. VIM Picture! Copy-Past-DeleteCopyCopy the current line where the cusor locate in. yy Copy n lines from the ...
Read more »

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in ...
Read more »

基础知识编译与执行程序GNU编译器:1$ g++ prog1.cc -o prog1 不带"-o prog1"参数,编译器在UNIX系统下产生名为 a.out 而在 windows 下产生名为 a.exe的可执行文件. 微软编译器采用 cl 命令来调用:12345# 这条命令自动产生与源文件同名的可 ...
Read more »

Ubuntu 终端常用快捷键: Tab 自动补全 Ctrl+a 光标移动到开始位置 Ctrl+e 光标移动到最末尾 Ctrl+k 删除此处至末尾的所有内容 Ctrl+u ...
Read more »

从文件内容查找指定的字符串 grep: grep "search-string" filename 例子:在当前目录里第一级文件夹中寻找包含指定字符串的.sh文件 grep "while" */*.sh #从文件内容中查找与正则表达式匹配的行: $ gre ...
Read more »